diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-12-16 15:25:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:38:25 -0400 |
commit | 8940b4f312dced51b45004819b776ec3aa7fcd5d (patch) | |
tree | f994df6952a12ad5a3b46762e8a53eaa99f215b6 /drivers/base/dd.c | |
parent | f791b8c836307b58cbf62133a6a772ed1a92fb33 (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 0dfd08c15921..f17c3266a0e0 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | static void driver_bound(struct device *dev) | 31 | static void driver_bound(struct device *dev) |
32 | { | 32 | { |
33 | if (klist_node_attached(&dev->knode_driver)) { | 33 | if (klist_node_attached(&dev->p->knode_driver)) { |
34 | printk(KERN_WARNING "%s: device %s already bound\n", | 34 | printk(KERN_WARNING "%s: device %s already bound\n", |
35 | __func__, kobject_name(&dev->kobj)); | 35 | __func__, kobject_name(&dev->kobj)); |
36 | return; | 36 | return; |
@@ -43,7 +43,7 @@ static void driver_bound(struct device *dev) | |||
43 | blocking_notifier_call_chain(&dev->bus->p->bus_notifier, | 43 | blocking_notifier_call_chain(&dev->bus->p->bus_notifier, |
44 | BUS_NOTIFY_BOUND_DRIVER, dev); | 44 | BUS_NOTIFY_BOUND_DRIVER, dev); |
45 | 45 | ||
46 | klist_add_tail(&dev->knode_driver, &dev->driver->p->klist_devices); | 46 | klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); |
47 | } | 47 | } |
48 | 48 | ||
49 | static int driver_sysfs_add(struct device *dev) | 49 | static int driver_sysfs_add(struct device *dev) |
@@ -318,7 +318,7 @@ static void __device_release_driver(struct device *dev) | |||
318 | drv->remove(dev); | 318 | drv->remove(dev); |
319 | devres_release_all(dev); | 319 | devres_release_all(dev); |
320 | dev->driver = NULL; | 320 | dev->driver = NULL; |
321 | klist_remove(&dev->knode_driver); | 321 | klist_remove(&dev->p->knode_driver); |
322 | } | 322 | } |
323 | } | 323 | } |
324 | 324 | ||
@@ -348,6 +348,7 @@ EXPORT_SYMBOL_GPL(device_release_driver); | |||
348 | */ | 348 | */ |
349 | void driver_detach(struct device_driver *drv) | 349 | void driver_detach(struct device_driver *drv) |
350 | { | 350 | { |
351 | struct device_private *dev_prv; | ||
351 | struct device *dev; | 352 | struct device *dev; |
352 | 353 | ||
353 | for (;;) { | 354 | for (;;) { |
@@ -356,8 +357,10 @@ void driver_detach(struct device_driver *drv) | |||
356 | spin_unlock(&drv->p->klist_devices.k_lock); | 357 | spin_unlock(&drv->p->klist_devices.k_lock); |
357 | break; | 358 | break; |
358 | } | 359 | } |
359 | dev = list_entry(drv->p->klist_devices.k_list.prev, | 360 | dev_prv = list_entry(drv->p->klist_devices.k_list.prev, |
360 | struct device, knode_driver.n_node); | 361 | struct device_private, |
362 | knode_driver.n_node); | ||
363 | dev = dev_prv->device; | ||
361 | get_device(dev); | 364 | get_device(dev); |
362 | spin_unlock(&drv->p->klist_devices.k_lock); | 365 | spin_unlock(&drv->p->klist_devices.k_lock); |
363 | 366 | ||