diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-12-16 15:25:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:44:32 -0500 |
commit | 93e746db183b3bdbbda67900f79b5835f9cb388f (patch) | |
tree | 658cb2c8cac313b7e2cc94f914dac52996432c93 /drivers/base/dd.c | |
parent | 11c3b5c3e08f4d855cbef52883c266b9ab9df879 (diff) |
driver core: move knode_driver into private structure
Nothing outside of the driver core should ever touch knode_driver, so
move it out of the public eye.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r-- | drivers/base/dd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 17a8e45cf9c6..bb5f1eb83c03 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | static void driver_bound(struct device *dev) | 29 | static void driver_bound(struct device *dev) |
30 | { | 30 | { |
31 | if (klist_node_attached(&dev->knode_driver)) { | 31 | if (klist_node_attached(&dev->p->knode_driver)) { |
32 | printk(KERN_WARNING "%s: device %s already bound\n", | 32 | printk(KERN_WARNING "%s: device %s already bound\n", |
33 | __func__, kobject_name(&dev->kobj)); | 33 | __func__, kobject_name(&dev->kobj)); |
34 | return; | 34 | return; |
@@ -41,7 +41,7 @@ static void driver_bound(struct device *dev) | |||
41 | blocking_notifier_call_chain(&dev->bus->p->bus_notifier, | 41 | blocking_notifier_call_chain(&dev->bus->p->bus_notifier, |
42 | BUS_NOTIFY_BOUND_DRIVER, dev); | 42 | BUS_NOTIFY_BOUND_DRIVER, dev); |
43 | 43 | ||
44 | klist_add_tail(&dev->knode_driver, &dev->driver->p->klist_devices); | 44 | klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); |
45 | } | 45 | } |
46 | 46 | ||
47 | static int driver_sysfs_add(struct device *dev) | 47 | static int driver_sysfs_add(struct device *dev) |
@@ -311,7 +311,7 @@ static void __device_release_driver(struct device *dev) | |||
311 | drv->remove(dev); | 311 | drv->remove(dev); |
312 | devres_release_all(dev); | 312 | devres_release_all(dev); |
313 | dev->driver = NULL; | 313 | dev->driver = NULL; |
314 | klist_remove(&dev->knode_driver); | 314 | klist_remove(&dev->p->knode_driver); |
315 | } | 315 | } |
316 | } | 316 | } |
317 | 317 | ||
@@ -341,6 +341,7 @@ EXPORT_SYMBOL_GPL(device_release_driver); | |||
341 | */ | 341 | */ |
342 | void driver_detach(struct device_driver *drv) | 342 | void driver_detach(struct device_driver *drv) |
343 | { | 343 | { |
344 | struct device_private *dev_prv; | ||
344 | struct device *dev; | 345 | struct device *dev; |
345 | 346 | ||
346 | for (;;) { | 347 | for (;;) { |
@@ -349,8 +350,10 @@ void driver_detach(struct device_driver *drv) | |||
349 | spin_unlock(&drv->p->klist_devices.k_lock); | 350 | spin_unlock(&drv->p->klist_devices.k_lock); |
350 | break; | 351 | break; |
351 | } | 352 | } |
352 | dev = list_entry(drv->p->klist_devices.k_list.prev, | 353 | dev_prv = list_entry(drv->p->klist_devices.k_list.prev, |
353 | struct device, knode_driver.n_node); | 354 | struct device_private, |
355 | knode_driver.n_node); | ||
356 | dev = dev_prv->device; | ||
354 | get_device(dev); | 357 | get_device(dev); |
355 | spin_unlock(&drv->p->klist_devices.k_lock); | 358 | spin_unlock(&drv->p->klist_devices.k_lock); |
356 | 359 | ||