Re: What is struct pci_driver.owner for?
From: Russell King
Date: Tue Oct 18 2005 - 16:05:49 EST
On Tue, Oct 18, 2005 at 01:59:08PM -0700, Greg KH wrote:
> On Tue, Oct 18, 2005 at 04:53:36PM -0400, Jeff Garzik wrote:
> > Roland Dreier wrote:
> > >I just noticed that at some point, struct pci_driver grew a .owner
> > >member. However, only a handful of drivers set it:
> > >
> > > $ grep -r -A10 pci_driver drivers/ | grep owner
> > > drivers/block/sx8.c- .owner = THIS_MODULE,
> > > drivers/ieee1394/pcilynx.c- .owner = THIS_MODULE,
> > > drivers/net/spider_net.c- .owner = THIS_MODULE,
> > > drivers/video/imsttfb.c- .owner = THIS_MODULE,
> > > drivers/video/kyro/fbdev.c- .owner = THIS_MODULE,
> > > drivers/video/tridentfb.c- .owner = THIS_MODULE,
> > >
> > >Should all drivers be setting .owner = THIS_MODULE? Is this a good
> > >kernel janitors task?
> >
> > In theory its for module refcounting. With so many PCI drivers and so
> > few pci_driver::owner users, it makes me wonder how needed it is.
>
> It might in the future be needed for refcounting, I originally added it
> when I thought it was needed.
Note that both pci_driver and pci_driver.driver both have an "owner"
field. One should go - there's no point needlessly duplicating stuff
like this.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/