aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/module.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-28 15:59:15 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:35 -0800
commite5dd12784617f0f1fae5f96a7fac1ec4c49fadbe (patch)
treec81e2a2f3aa1c60b92951d398774f1391bdc6a1c /drivers/base/module.c
parentc63469a3985a9771c18a916b8d42845d044ea0b1 (diff)
downloadvexpress-lsk-e5dd12784617f0f1fae5f96a7fac1ec4c49fadbe.tar.gz
Driver core: move the static kobject out of struct driver
This patch removes the kobject, and a few other driver-core-only fields out of struct driver and into the driver core only. Now drivers can be safely create on the stack or statically (like they currently are.) Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/module.c')
-rw-r--r--drivers/base/module.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/module.c b/drivers/base/module.c
index cad07be5de1..103be9cacb0 100644
--- a/drivers/base/module.c
+++ b/drivers/base/module.c
@@ -50,7 +50,7 @@ void module_add_driver(struct module *mod, struct device_driver *drv)
if (mkobj) {
mk = container_of(mkobj, struct module_kobject, kobj);
/* remember our module structure */
- drv->mkobj = mk;
+ drv->p->mkobj = mk;
/* kset_find_obj took a reference */
kobject_put(mkobj);
}
@@ -60,11 +60,11 @@ void module_add_driver(struct module *mod, struct device_driver *drv)
return;
/* Don't check return codes; these calls are idempotent */
- no_warn = sysfs_create_link(&drv->kobj, &mk->kobj, "module");
+ no_warn = sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
driver_name = make_driver_name(drv);
if (driver_name) {
module_create_drivers_dir(mk);
- no_warn = sysfs_create_link(mk->drivers_dir, &drv->kobj,
+ no_warn = sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
driver_name);
kfree(driver_name);
}
@@ -78,12 +78,12 @@ void module_remove_driver(struct device_driver *drv)
if (!drv)
return;
- sysfs_remove_link(&drv->kobj, "module");
+ sysfs_remove_link(&drv->p->kobj, "module");
if (drv->owner)
mk = &drv->owner->mkobj;
- else if (drv->mkobj)
- mk = drv->mkobj;
+ else if (drv->p->mkobj)
+ mk = drv->p->mkobj;
if (mk && mk->drivers_dir) {
driver_name = make_driver_name(drv);
if (driver_name) {