aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/message.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-07-21 10:31:22 -0400
committerArnd Bergmann <arnd@arndb.de>2011-07-21 10:31:22 -0400
commitab2a0e0d135490729e384c1826d118f92e88cae8 (patch)
tree58ab1e9e5d549feac9bf3beacbb6942f50d0bed9 /drivers/usb/core/message.c
parent09dd9b39abf85b8fae3ea105a81825478dd227b6 (diff)
parent2f3ab04a47c9b5e7c93400601e8f69bef0fa184a (diff)
Merge branch 'next-samsung-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/cleanup
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r--drivers/usb/core/message.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 64c7ab4702df..0b5ec234c787 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1147,6 +1147,14 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
1147 * any drivers bound to them (a key side effect) 1147 * any drivers bound to them (a key side effect)
1148 */ 1148 */
1149 if (dev->actconfig) { 1149 if (dev->actconfig) {
1150 /*
1151 * FIXME: In order to avoid self-deadlock involving the
1152 * bandwidth_mutex, we have to mark all the interfaces
1153 * before unregistering any of them.
1154 */
1155 for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++)
1156 dev->actconfig->interface[i]->unregistering = 1;
1157
1150 for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { 1158 for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
1151 struct usb_interface *interface; 1159 struct usb_interface *interface;
1152 1160
@@ -1156,7 +1164,6 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
1156 continue; 1164 continue;
1157 dev_dbg(&dev->dev, "unregistering interface %s\n", 1165 dev_dbg(&dev->dev, "unregistering interface %s\n",
1158 dev_name(&interface->dev)); 1166 dev_name(&interface->dev));
1159 interface->unregistering = 1;
1160 remove_intf_ep_devs(interface); 1167 remove_intf_ep_devs(interface);
1161 device_del(&interface->dev); 1168 device_del(&interface->dev);
1162 } 1169 }
@@ -1286,6 +1293,8 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
1286 interface); 1293 interface);
1287 return -EINVAL; 1294 return -EINVAL;
1288 } 1295 }
1296 if (iface->unregistering)
1297 return -ENODEV;
1289 1298
1290 alt = usb_altnum_to_altsetting(iface, alternate); 1299 alt = usb_altnum_to_altsetting(iface, alternate);
1291 if (!alt) { 1300 if (!alt) {