diff options
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r-- | drivers/base/dd.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 6fdaf76f033f..315bed8d5e7f 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->p->knode_driver)) { | 31 | if (klist_node_attached(&dev->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->p->knode_driver, &dev->driver->p->klist_devices); | 44 | klist_add_tail(&dev->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) |
@@ -310,7 +310,7 @@ static void __device_release_driver(struct device *dev) | |||
310 | drv->remove(dev); | 310 | drv->remove(dev); |
311 | devres_release_all(dev); | 311 | devres_release_all(dev); |
312 | dev->driver = NULL; | 312 | dev->driver = NULL; |
313 | klist_remove(&dev->p->knode_driver); | 313 | klist_remove(&dev->knode_driver); |
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
@@ -340,7 +340,6 @@ EXPORT_SYMBOL_GPL(device_release_driver); | |||
340 | */ | 340 | */ |
341 | void driver_detach(struct device_driver *drv) | 341 | void driver_detach(struct device_driver *drv) |
342 | { | 342 | { |
343 | struct device_private *dev_prv; | ||
344 | struct device *dev; | 343 | struct device *dev; |
345 | 344 | ||
346 | for (;;) { | 345 | for (;;) { |
@@ -349,10 +348,8 @@ void driver_detach(struct device_driver *drv) | |||
349 | spin_unlock(&drv->p->klist_devices.k_lock); | 348 | spin_unlock(&drv->p->klist_devices.k_lock); |
350 | break; | 349 | break; |
351 | } | 350 | } |
352 | dev_prv = list_entry(drv->p->klist_devices.k_list.prev, | 351 | dev = list_entry(drv->p->klist_devices.k_list.prev, |
353 | struct device_private, | 352 | struct device, knode_driver.n_node); |
354 | knode_driver.n_node); | ||
355 | dev = dev_prv->device; | ||
356 | get_device(dev); | 353 | get_device(dev); |
357 | spin_unlock(&drv->p->klist_devices.k_lock); | 354 | spin_unlock(&drv->p->klist_devices.k_lock); |
358 | 355 | ||