summaryrefslogtreecommitdiff
path: root/drivers/usb/core/devio.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-08-10 21:12:31 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 23:28:19 (GMT)
commitbf193d3cd2a3b73f2df74f57106114867946c09c (patch)
treecc47350df18dd7bf00a3adb136476e1896f20c19 /drivers/usb/core/devio.c
parent8b28c7526a302bbfa618f7eab4ef961edd68c9a0 (diff)
downloadlinux-fsl-qoriq-bf193d3cd2a3b73f2df74f57106114867946c09c.tar.xz
[PATCH] USB: Disconnect children when unbinding the hub driver
This patch (as554) makes the hub driver disconnect any child USB devices when it is unbound from a hub. Normally this will never happen, but there are a few oddball ways to unbind the hub driver while leaving the children intact. For example, the new "unbind" sysfs attribute can be used for this purpose. Given that unbinding hubs with children is now safe, the patch also removes the code that prevented people from doing so using usbfs. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r--drivers/usb/core/devio.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 56c082f..b4265aa 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1238,7 +1238,6 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
int retval = 0;
struct usb_interface *intf = NULL;
struct usb_driver *driver = NULL;
- int i;
/* get input parameters and alloc buffer */
if (copy_from_user(&ctrl, arg, sizeof (ctrl)))
@@ -1270,15 +1269,6 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
/* disconnect kernel driver from interface */
case USBDEVFS_DISCONNECT:
- /* don't allow the user to unbind the hub driver from
- * a hub with children to manage */
- for (i = 0; i < ps->dev->maxchild; ++i) {
- if (ps->dev->children[i])
- retval = -EBUSY;
- }
- if (retval)
- break;
-
down_write(&usb_bus_type.subsys.rwsem);
if (intf->dev.driver) {
driver = to_usb_driver(intf->dev.driver);