LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 9/28] PCI: add the sysfs driver name to all modules
Date: Wed, 7 Feb 2007 16:29:57 -0800 [thread overview]
Message-ID: <1170894650872-git-send-email-greg@kroah.com> (raw)
In-Reply-To: <11708946472324-git-send-email-greg@kroah.com>
From: Greg Kroah-Hartman <gregkh@suse.de>
This adds the module name to all PCI drivers, if they are built into the
kernel or not. It will show up in /sys/modules/MODULE_NAME/drivers/
It also fixes up the IDE core, which was calling __pci_register_driver()
directly.
Cc: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/ide/setup-pci.c | 7 ++++---
drivers/pci/pci-driver.c | 4 +++-
include/linux/ide.h | 4 ++--
include/linux/pci.h | 5 +++--
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 695e239..a52c80f 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -783,10 +783,11 @@ static LIST_HEAD(ide_pci_drivers);
* Returns are the same as for pci_register_driver
*/
-int __ide_pci_register_driver(struct pci_driver *driver, struct module *module)
+int __ide_pci_register_driver(struct pci_driver *driver, struct module *module,
+ const char *mod_name)
{
if(!pre_init)
- return __pci_register_driver(driver, module);
+ return __pci_register_driver(driver, module, mod_name);
driver->driver.owner = module;
list_add_tail(&driver->node, &ide_pci_drivers);
return 0;
@@ -862,6 +863,6 @@ void __init ide_scan_pcibus (int scan_direction)
{
list_del(l);
d = list_entry(l, struct pci_driver, node);
- __pci_register_driver(d, d->driver.owner);
+ __pci_register_driver(d, d->driver.owner, d->driver.mod_name);
}
}
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 92d5e8d..3587668 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -422,7 +422,8 @@ static struct kobj_type pci_driver_kobj_type = {
* If no error occurred, the driver remains registered even if
* no device was claimed during registration.
*/
-int __pci_register_driver(struct pci_driver *drv, struct module *owner)
+int __pci_register_driver(struct pci_driver *drv, struct module *owner,
+ const char *mod_name)
{
int error;
@@ -430,6 +431,7 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner)
drv->driver.name = drv->name;
drv->driver.bus = &pci_bus_type;
drv->driver.owner = owner;
+ drv->driver.mod_name = mod_name;
drv->driver.kobj.ktype = &pci_driver_kobj_type;
if (pci_multithread_probe)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e26a039..827688f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1192,8 +1192,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
extern int ideprobe_init(void);
extern void ide_scan_pcibus(int scan_direction) __init;
-extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner);
-#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
+extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name);
+#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME)
void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
extern 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 f3c617e..cb899eb 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -573,10 +573,11 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
void pci_enable_bridges(struct pci_bus *bus);
/* Proper probing supporting hot-pluggable devices */
-int __must_check __pci_register_driver(struct pci_driver *, struct module *);
+int __must_check __pci_register_driver(struct pci_driver *, struct module *,
+ const char *mod_name);
static inline int __must_check pci_register_driver(struct pci_driver *driver)
{
- return __pci_register_driver(driver, THIS_MODULE);
+ return __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
}
void pci_unregister_driver(struct pci_driver *);
--
1.4.4.4
next prev parent reply other threads:[~2007-02-08 0:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-08 0:29 [GIT PATCH] Driver core patches for 2.6.20 Greg KH
2007-02-08 0:29 ` [PATCH 1/28] Kobject: make kobject apis more robust in handling NULL pointers Greg KH
2007-02-08 0:29 ` [PATCH 2/28] Driver core: convert pcmcia code to use struct device Greg KH
2007-02-08 0:29 ` [PATCH 3/28] Driver core: convert SPI " Greg KH
2007-02-08 0:29 ` [PATCH 4/28] Network: convert network devices to use struct device instead of class_device Greg KH
2007-02-08 0:29 ` [PATCH 5/28] driver core: Remove device_is_registered() in device_move() Greg KH
2007-02-08 0:29 ` [PATCH 6/28] driver core: Allow device_move(dev, NULL) Greg KH
2007-02-08 0:29 ` [PATCH 7/28] MODULES: add the module name for built in kernel drivers Greg KH
2007-02-08 0:29 ` [PATCH 8/28] Modules: only add drivers/ direcory if needed Greg KH
2007-02-08 0:29 ` Greg KH [this message]
2007-02-08 0:29 ` [PATCH 10/28] SERIO: add the sysfs driver name to all modules Greg KH
2007-02-08 0:29 ` [PATCH 11/28] USB: " Greg KH
2007-02-08 0:30 ` [PATCH 12/28] /sys/modules/*/holders Greg KH
2007-02-08 0:30 ` [PATCH 13/28] driver core fixes: make_class_name() retval checks Greg KH
2007-02-08 0:30 ` [PATCH 14/28] driver core fixes: device_register() retval check in platform.c Greg KH
2007-02-08 0:30 ` [PATCH 15/28] driver core: Don't stop probing on ->probe errors Greg KH
2007-02-08 0:30 ` [PATCH 16/28] driver core: Change function call order in device_bind_driver() Greg KH
2007-02-08 0:30 ` [PATCH 17/28] Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() Greg KH
2007-02-08 0:30 ` [PATCH 18/28] sysfs: suppress lockdep warnings Greg KH
2007-02-08 0:30 ` [PATCH 19/28] sysfs: kobject_put cleanup Greg KH
2007-02-08 0:30 ` [PATCH 20/28] kobject: " Greg KH
2007-02-08 0:30 ` [PATCH 21/28] sysfs: error handling in sysfs, fill_read_buffer() Greg KH
2007-02-08 0:30 ` [PATCH 22/28] HOWTO: Add a reference to Harbison and Steele Greg KH
2007-02-08 0:30 ` [PATCH 23/28] SYSFS: Fix missing include of list.h in sysfs.h Greg KH
2007-02-08 0:30 ` [PATCH 24/28] Driver core: add uevent vars for devices of a class Greg KH
2007-02-08 0:30 ` [PATCH 25/28] Driver core: add device_type to struct device Greg KH
2007-02-08 0:30 ` [PATCH 26/28] Driver core: allow to delay the uevent at device creation time Greg KH
2007-02-08 0:30 ` [PATCH 27/28] Driver Core: Increase the default timeout value of the firmware subsystem Greg KH
2007-02-08 0:30 ` [PATCH 28/28] sysfs: Shadow directory support Greg KH
2007-02-08 17:20 ` [PATCH 10/28] SERIO: add the sysfs driver name to all modules Dmitry Torokhov
2007-02-08 18:51 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1170894650872-git-send-email-greg@kroah.com \
--to=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [PATCH 9/28] PCI: add the sysfs driver name to all modules' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).