X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fbase%2Fdd.c;h=7ac474db88c525f46a0846810ca5f384fa07b104;hb=97a4649d6ffce4a5d7f5ce018d87a6cefcb4ad03;hp=b0088b0efecdd1e5395e4104d23d0fe34dbb9a0d;hpb=08f3dfe8c4b91189890019d307aad236c3633515;p=~andy%2Flinux diff --git a/drivers/base/dd.c b/drivers/base/dd.c index b0088b0efec..7ac474db88c 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -281,24 +281,16 @@ int driver_attach(struct device_driver * drv) return bus_for_each_dev(drv->bus, NULL, drv, __driver_attach); } -/** - * device_release_driver - manually detach device from driver. - * @dev: device. - * - * Manually detach device from driver. - * +/* * __device_release_driver() must be called with @dev->sem held. - * When called for a USB interface, @dev->parent->sem must be held - * as well. + * When called for a USB interface, @dev->parent->sem must be held as well. */ - static void __device_release_driver(struct device * dev) { struct device_driver * drv; - drv = dev->driver; + drv = get_driver(dev->driver); if (drv) { - get_driver(drv); driver_sysfs_remove(dev); sysfs_remove_link(&dev->kobj, "driver"); klist_remove(&dev->knode_driver); @@ -318,6 +310,13 @@ static void __device_release_driver(struct device * dev) } } +/** + * device_release_driver - manually detach device from driver. + * @dev: device. + * + * Manually detach device from driver. + * When called for a USB interface, @dev->parent->sem must be held. + */ void device_release_driver(struct device * dev) { /*