aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLaurent riffard <laurent.riffard@free.fr>2005-10-27 17:12:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-11-10 19:09:16 -0500
commit863b18f4b5e7d9e6903b353328cf6fa084dbb619 (patch)
treee181466c3e7e676fa08e4bce2052ada38d98228d /include
parentf8eb1005a5bdb019d2a4ff3ef8d8e8015b22afcb (diff)
[PATCH] PCI: automatically set device_driver.owner
A nice feature of sysfs is that it can create the symlink from the driver to the module that is contained in it. It requires that the device_driver.owner is set, what is not the case for many PCI drivers. This patch allows pci_register_driver to set automatically the device_driver.owner for any PCI driver. Credits to Al Viro who suggested the method. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> -- drivers/ide/setup-pci.c | 12 +++++++----- drivers/pci/pci-driver.c | 9 +++++---- include/linux/ide.h | 3 ++- include/linux/pci.h | 10 ++++++++-- 4 files changed, 22 insertions(+), 12 deletions(-)
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h3
-rw-r--r--include/linux/pci.h10
2 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 77ae55d4c13c..ac8b25fa6506 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1329,7 +1329,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
1329extern int ideprobe_init(void); 1329extern int ideprobe_init(void);
1330 1330
1331extern void ide_scan_pcibus(int scan_direction) __init; 1331extern void ide_scan_pcibus(int scan_direction) __init;
1332extern int ide_pci_register_driver(struct pci_driver *driver); 1332extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner);
1333#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
1333extern void ide_pci_unregister_driver(struct pci_driver *driver); 1334extern void ide_pci_unregister_driver(struct pci_driver *driver);
1334void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); 1335void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
1335extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); 1336extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7063241e34d9..60702fccf9e7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -433,8 +433,13 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
433 void *alignf_data); 433 void *alignf_data);
434void pci_enable_bridges(struct pci_bus *bus); 434void pci_enable_bridges(struct pci_bus *bus);
435 435
436/* New-style probing supporting hot-pluggable devices */ 436/* Proper probing supporting hot-pluggable devices */
437int pci_register_driver(struct pci_driver *); 437int __pci_register_driver(struct pci_driver *, struct module *);
438static inline int pci_register_driver(struct pci_driver *driver)
439{
440 return __pci_register_driver(driver, THIS_MODULE);
441}
442
438void pci_unregister_driver(struct pci_driver *); 443void pci_unregister_driver(struct pci_driver *);
439void pci_remove_behind_bridge(struct pci_dev *); 444void pci_remove_behind_bridge(struct pci_dev *);
440struct pci_driver *pci_dev_driver(const struct pci_dev *); 445struct pci_driver *pci_dev_driver(const struct pci_dev *);
@@ -548,6 +553,7 @@ static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
548static inline void pci_disable_device(struct pci_dev *dev) { } 553static inline void pci_disable_device(struct pci_dev *dev) { }
549static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } 554static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; }
550static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} 555static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;}
556static inline int __pci_register_driver(struct pci_driver *drv, struct module *owner) { return 0;}
551static inline int pci_register_driver(struct pci_driver *drv) { return 0;} 557static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
552static inline void pci_unregister_driver(struct pci_driver *drv) { } 558static inline void pci_unregister_driver(struct pci_driver *drv) { }
553static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 559static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }