Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 885e9747 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman
Browse files

USB: repair USBDEVFS_CONNECT ioctl



For as long as I've known about it, the USBDEVFS_CONNECT ioctl hasn't
done what it's supposed to.  The current code reprobes _all_ the
unbound USB interfaces; this patch (as1021) makes it reprobe only the
interface for which it was called.

Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent badef819
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1373,9 +1373,10 @@ static int proc_ioctl(struct dev_state *ps, struct usbdevfs_ioctl *ctl)

	/* let kernel drivers try to (re)bind to the interface */
	case USBDEVFS_CONNECT:
		usb_unlock_device(ps->dev);
		retval = bus_rescan_devices(intf->dev.bus);
		usb_lock_device(ps->dev);
		if (!intf->dev.driver)
			retval = device_attach(&intf->dev);
		else
			retval = -EBUSY;
		break;

	/* talk directly to the interface's driver */