diff options
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r-- | drivers/base/dd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index b0088b0efecd..7ac474db88c5 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -281,24 +281,16 @@ int driver_attach(struct device_driver * drv) | |||
281 | return bus_for_each_dev(drv->bus, NULL, drv, __driver_attach); | 281 | return bus_for_each_dev(drv->bus, NULL, drv, __driver_attach); |
282 | } | 282 | } |
283 | 283 | ||
284 | /** | 284 | /* |
285 | * device_release_driver - manually detach device from driver. | ||
286 | * @dev: device. | ||
287 | * | ||
288 | * Manually detach device from driver. | ||
289 | * | ||
290 | * __device_release_driver() must be called with @dev->sem held. | 285 | * __device_release_driver() must be called with @dev->sem held. |
291 | * When called for a USB interface, @dev->parent->sem must be held | 286 | * When called for a USB interface, @dev->parent->sem must be held as well. |
292 | * as well. | ||
293 | */ | 287 | */ |
294 | |||
295 | static void __device_release_driver(struct device * dev) | 288 | static void __device_release_driver(struct device * dev) |
296 | { | 289 | { |
297 | struct device_driver * drv; | 290 | struct device_driver * drv; |
298 | 291 | ||
299 | drv = dev->driver; | 292 | drv = get_driver(dev->driver); |
300 | if (drv) { | 293 | if (drv) { |
301 | get_driver(drv); | ||
302 | driver_sysfs_remove(dev); | 294 | driver_sysfs_remove(dev); |
303 | sysfs_remove_link(&dev->kobj, "driver"); | 295 | sysfs_remove_link(&dev->kobj, "driver"); |
304 | klist_remove(&dev->knode_driver); | 296 | klist_remove(&dev->knode_driver); |
@@ -318,6 +310,13 @@ static void __device_release_driver(struct device * dev) | |||
318 | } | 310 | } |
319 | } | 311 | } |
320 | 312 | ||
313 | /** | ||
314 | * device_release_driver - manually detach device from driver. | ||
315 | * @dev: device. | ||
316 | * | ||
317 | * Manually detach device from driver. | ||
318 | * When called for a USB interface, @dev->parent->sem must be held. | ||
319 | */ | ||
321 | void device_release_driver(struct device * dev) | 320 | void device_release_driver(struct device * dev) |
322 | { | 321 | { |
323 | /* | 322 | /* |