Re: [PATCH v2 3/7] PCI: dra7xx: Set drvdata at end of probe function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 12, 2016 at 02:48:02PM -0500, Andrew F. Davis wrote:
> On 10/12/2016 08:32 AM, Bjorn Helgaas wrote:
> > Set the drvdata pointer at the end of probe function for consistency with
> > other drivers. 
> 
> I've seen it done the current way many places.
> 
> > We don't need the drvdata until after the probe completes,
> > and we don't need it at all if the probe fails. 
> 
> Are you sure this will always be true? Why not set it as soon as we have
> the ability to, what do we gain by waiting till the end, something like
> one less instruction in the failure case?

I don't think it's likely anybody will need it before .probe()
completes, because the purpose of drvdata is for an external driver
entry point to locate its device data, and none of those entry points
will be called until after .probe() completes successfully.

But I don't care at all if we do it earlier, as long as all the
drivers do it the same way.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux