diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-28 18:59:15 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:35 -0500 |
commit | e5dd12784617f0f1fae5f96a7fac1ec4c49fadbe (patch) | |
tree | c81e2a2f3aa1c60b92951d398774f1391bdc6a1c /drivers/base/module.c | |
parent | c63469a3985a9771c18a916b8d42845d044ea0b1 (diff) |
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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/module.c b/drivers/base/module.c index cad07be5de1a..103be9cacb05 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) | |||
50 | if (mkobj) { | 50 | if (mkobj) { |
51 | mk = container_of(mkobj, struct module_kobject, kobj); | 51 | mk = container_of(mkobj, struct module_kobject, kobj); |
52 | /* remember our module structure */ | 52 | /* remember our module structure */ |
53 | drv->mkobj = mk; | 53 | drv->p->mkobj = mk; |
54 | /* kset_find_obj took a reference */ | 54 | /* kset_find_obj took a reference */ |
55 | kobject_put(mkobj); | 55 | kobject_put(mkobj); |
56 | } | 56 | } |
@@ -60,11 +60,11 @@ void module_add_driver(struct module *mod, struct device_driver *drv) | |||
60 | return; | 60 | return; |
61 | 61 | ||
62 | /* Don't check return codes; these calls are idempotent */ | 62 | /* Don't check return codes; these calls are idempotent */ |
63 | no_warn = sysfs_create_link(&drv->kobj, &mk->kobj, "module"); | 63 | no_warn = sysfs_create_link(&drv->p->kobj, &mk->kobj, "module"); |
64 | driver_name = make_driver_name(drv); | 64 | driver_name = make_driver_name(drv); |
65 | if (driver_name) { | 65 | if (driver_name) { |
66 | module_create_drivers_dir(mk); | 66 | module_create_drivers_dir(mk); |
67 | no_warn = sysfs_create_link(mk->drivers_dir, &drv->kobj, | 67 | no_warn = sysfs_create_link(mk->drivers_dir, &drv->p->kobj, |
68 | driver_name); | 68 | driver_name); |
69 | kfree(driver_name); | 69 | kfree(driver_name); |
70 | } | 70 | } |
@@ -78,12 +78,12 @@ void module_remove_driver(struct device_driver *drv) | |||
78 | if (!drv) | 78 | if (!drv) |
79 | return; | 79 | return; |
80 | 80 | ||
81 | sysfs_remove_link(&drv->kobj, "module"); | 81 | sysfs_remove_link(&drv->p->kobj, "module"); |
82 | 82 | ||
83 | if (drv->owner) | 83 | if (drv->owner) |
84 | mk = &drv->owner->mkobj; | 84 | mk = &drv->owner->mkobj; |
85 | else if (drv->mkobj) | 85 | else if (drv->p->mkobj) |
86 | mk = drv->mkobj; | 86 | mk = drv->p->mkobj; |
87 | if (mk && mk->drivers_dir) { | 87 | if (mk && mk->drivers_dir) { |
88 | driver_name = make_driver_name(drv); | 88 | driver_name = make_driver_name(drv); |
89 | if (driver_name) { | 89 | if (driver_name) { |