* [patch] drivers/block: updates .owner field of struct pci_driver [not found] <20051023204947.430464000@antares.localdomain> @ 2005-10-23 20:49 ` Laurent Riffard 2005-10-23 21:13 ` Russell King 0 siblings, 1 reply; 5+ messages in thread From: Laurent Riffard @ 2005-10-23 20:49 UTC (permalink / raw) To: linux-kernel, dmo, mike.miller, iss_storagedev, Jeff Garzik [-- Attachment #1: driver_block_pci_driver_owner_field.patch --] [-- Type: text/plain, Size: 2465 bytes --] This patch updates .owner field of struct pci_driver. This allows SYSFS to create the symlink from the driver to the module which provides it. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> -- drivers/block/DAC960.c | 1 + drivers/block/cciss.c | 1 + drivers/block/cpqarray.c | 1 + drivers/block/sx8.c | 1 + drivers/block/umem.c | 1 + 5 files changed, 5 insertions(+) Index: linux-2.6-stable/drivers/block/DAC960.c =================================================================== --- linux-2.6-stable.orig/drivers/block/DAC960.c +++ linux-2.6-stable/drivers/block/DAC960.c @@ -7185,6 +7185,7 @@ MODULE_DEVICE_TABLE(pci, DAC960_id_table); static struct pci_driver DAC960_pci_driver = { + .owner = THIS_MODULE, .name = "DAC960", .id_table = DAC960_id_table, .probe = DAC960_Probe, Index: linux-2.6-stable/drivers/block/cciss.c =================================================================== --- linux-2.6-stable.orig/drivers/block/cciss.c +++ linux-2.6-stable/drivers/block/cciss.c @@ -2929,6 +2929,7 @@ } static struct pci_driver cciss_pci_driver = { + .owner = THIS_MODULE, .name = "cciss", .probe = cciss_init_one, .remove = __devexit_p(cciss_remove_one), Index: linux-2.6-stable/drivers/block/cpqarray.c =================================================================== --- linux-2.6-stable.orig/drivers/block/cpqarray.c +++ linux-2.6-stable/drivers/block/cpqarray.c @@ -541,6 +541,7 @@ } static struct pci_driver cpqarray_pci_driver = { + .owner = THIS_MODULE, .name = "cpqarray", .probe = cpqarray_init_one, .remove = __devexit_p(cpqarray_remove_one_pci), Index: linux-2.6-stable/drivers/block/sx8.c =================================================================== --- linux-2.6-stable.orig/drivers/block/sx8.c +++ linux-2.6-stable/drivers/block/sx8.c @@ -395,6 +395,7 @@ MODULE_DEVICE_TABLE(pci, carm_pci_tbl); static struct pci_driver carm_driver = { + .owner = THIS_MODULE, .name = DRV_NAME, .id_table = carm_pci_tbl, .probe = carm_init_one, Index: linux-2.6-stable/drivers/block/umem.c =================================================================== --- linux-2.6-stable.orig/drivers/block/umem.c +++ linux-2.6-stable/drivers/block/umem.c @@ -1170,6 +1170,7 @@ MODULE_DEVICE_TABLE(pci, mm_pci_ids); static struct pci_driver mm_pci_driver = { + .owner = THIS_MODULE, .name = "umem", .id_table = mm_pci_ids, .probe = mm_pci_probe, -- ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] drivers/block: updates .owner field of struct pci_driver 2005-10-23 20:49 ` [patch] drivers/block: updates .owner field of struct pci_driver Laurent Riffard @ 2005-10-23 21:13 ` Russell King 2005-10-23 21:46 ` Al Viro 2005-10-23 22:29 ` Greg KH 0 siblings, 2 replies; 5+ messages in thread From: Russell King @ 2005-10-23 21:13 UTC (permalink / raw) To: Laurent Riffard, Greg KH Cc: linux-kernel, dmo, mike.miller, iss_storagedev, Jeff Garzik On Sun, Oct 23, 2005 at 10:49:48PM +0200, Laurent Riffard wrote: > This patch updates .owner field of struct pci_driver. > > This allows SYSFS to create the symlink from the driver to the > module which provides it. > > Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Wouldn't it be better to eliminate pci_driver's .owner field and set the generic device driver's owner field directly? (and fix the PCI code not to overwrite that if pci_driver's .owner field is NULL for compatibility.) I ask for the second time recently on linux-kernel. Is there *really* any point in duplicating these fields? -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] drivers/block: updates .owner field of struct pci_driver 2005-10-23 21:13 ` Russell King @ 2005-10-23 21:46 ` Al Viro 2005-10-25 20:17 ` Greg KH 2005-10-23 22:29 ` Greg KH 1 sibling, 1 reply; 5+ messages in thread From: Al Viro @ 2005-10-23 21:46 UTC (permalink / raw) To: Laurent Riffard, Greg KH, linux-kernel, dmo, mike.miller, iss_storagedev, Jeff Garzik Cc: Linus Torvalds On Sun, Oct 23, 2005 at 10:13:20PM +0100, Russell King wrote: > On Sun, Oct 23, 2005 at 10:49:48PM +0200, Laurent Riffard wrote: > > This patch updates .owner field of struct pci_driver. > > > > This allows SYSFS to create the symlink from the driver to the > > module which provides it. > > > > Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> > > Wouldn't it be better to eliminate pci_driver's .owner field and > set the generic device driver's owner field directly? (and fix > the PCI code not to overwrite that if pci_driver's .owner field > is NULL for compatibility.) > > I ask for the second time recently on linux-kernel. Is there > *really* any point in duplicating these fields? #define pci_register_driver(d) __pci_register_driver(d, THIS_MODULE) #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) __pci_register_driver(drv, module) - same as current pci_register_driver(), except that instead of drv->driver.owner = drv->owner; it does drv->driver.owner = module; __ide_pci_register_driver(driver, module): { if(!pre_init) return __pci_register_driver(driver, module); driver->driver.owner = module; list_add_tail(&driver->node, &ide_pci_drivers); return 0; } and in ide_scan_pcibus() turn pci_register_driver(d); into __pci_register_driver(d, d->driver.owner); Update exports (i.e. export __pci_register_driver and __ide_pci_register_driver instead of pci_register_driver and ide_pci_register_driver resp.). At which point pci_driver->owner become unused and can be killed at leisure. Objections? ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] drivers/block: updates .owner field of struct pci_driver 2005-10-23 21:46 ` Al Viro @ 2005-10-25 20:17 ` Greg KH 0 siblings, 0 replies; 5+ messages in thread From: Greg KH @ 2005-10-25 20:17 UTC (permalink / raw) To: Al Viro Cc: Laurent Riffard, linux-kernel, dmo, mike.miller, iss_storagedev, Jeff Garzik, Linus Torvalds On Sun, Oct 23, 2005 at 10:46:11PM +0100, Al Viro wrote: > On Sun, Oct 23, 2005 at 10:13:20PM +0100, Russell King wrote: > > On Sun, Oct 23, 2005 at 10:49:48PM +0200, Laurent Riffard wrote: > > > This patch updates .owner field of struct pci_driver. > > > > > > This allows SYSFS to create the symlink from the driver to the > > > module which provides it. > > > > > > Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> > > > > Wouldn't it be better to eliminate pci_driver's .owner field and > > set the generic device driver's owner field directly? (and fix > > the PCI code not to overwrite that if pci_driver's .owner field > > is NULL for compatibility.) > > > > I ask for the second time recently on linux-kernel. Is there > > *really* any point in duplicating these fields? > > #define pci_register_driver(d) __pci_register_driver(d, THIS_MODULE) > > #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) > > __pci_register_driver(drv, module) - same as current pci_register_driver(), > except that instead of > drv->driver.owner = drv->owner; > it does > drv->driver.owner = module; > > __ide_pci_register_driver(driver, module): > { > if(!pre_init) > return __pci_register_driver(driver, module); > driver->driver.owner = module; > list_add_tail(&driver->node, &ide_pci_drivers); > return 0; > } > > and in ide_scan_pcibus() turn > pci_register_driver(d); > into > __pci_register_driver(d, d->driver.owner); > > Update exports (i.e. export __pci_register_driver and __ide_pci_register_driver > instead of pci_register_driver and ide_pci_register_driver resp.). > > At which point pci_driver->owner become unused and can be killed at leisure. > Objections? No objections at all, that's a great way to handle this. thanks, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] drivers/block: updates .owner field of struct pci_driver 2005-10-23 21:13 ` Russell King 2005-10-23 21:46 ` Al Viro @ 2005-10-23 22:29 ` Greg KH 1 sibling, 0 replies; 5+ messages in thread From: Greg KH @ 2005-10-23 22:29 UTC (permalink / raw) To: Laurent Riffard, linux-kernel, dmo, mike.miller, iss_storagedev, Jeff Garzik On Sun, Oct 23, 2005 at 10:13:20PM +0100, Russell King wrote: > On Sun, Oct 23, 2005 at 10:49:48PM +0200, Laurent Riffard wrote: > > This patch updates .owner field of struct pci_driver. > > > > This allows SYSFS to create the symlink from the driver to the > > module which provides it. > > > > Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> > > Wouldn't it be better to eliminate pci_driver's .owner field and > set the generic device driver's owner field directly? (and fix > the PCI code not to overwrite that if pci_driver's .owner field > is NULL for compatibility.) No there isn't, we should use the struct device .name and .owner fields instead of the pci drivers's structure. Then we can just get rid of the pci driver's fields too. I just did this for the usb-serial drivers on Friday. thanks, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-10-25 20:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20051023204947.430464000@antares.localdomain>
2005-10-23 20:49 ` [patch] drivers/block: updates .owner field of struct pci_driver Laurent Riffard
2005-10-23 21:13 ` Russell King
2005-10-23 21:46 ` Al Viro
2005-10-25 20:17 ` Greg KH
2005-10-23 22:29 ` Greg KH
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox