aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 71475b6d8568..9db000013f5d 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1349,8 +1349,7 @@ static ssize_t composite_show_suspended(struct device *dev,
1349 1349
1350static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL); 1350static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL);
1351 1351
1352static void 1352static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver)
1353composite_unbind(struct usb_gadget *gadget)
1354{ 1353{
1355 struct usb_composite_dev *cdev = get_gadget_data(gadget); 1354 struct usb_composite_dev *cdev = get_gadget_data(gadget);
1356 1355
@@ -1367,7 +1366,7 @@ composite_unbind(struct usb_gadget *gadget)
1367 struct usb_configuration, list); 1366 struct usb_configuration, list);
1368 remove_config(cdev, c); 1367 remove_config(cdev, c);
1369 } 1368 }
1370 if (cdev->driver->unbind) 1369 if (cdev->driver->unbind && unbind_driver)
1371 cdev->driver->unbind(cdev); 1370 cdev->driver->unbind(cdev);
1372 1371
1373 if (cdev->req) { 1372 if (cdev->req) {
@@ -1380,6 +1379,11 @@ composite_unbind(struct usb_gadget *gadget)
1380 set_gadget_data(gadget, NULL); 1379 set_gadget_data(gadget, NULL);
1381} 1380}
1382 1381
1382static void composite_unbind(struct usb_gadget *gadget)
1383{
1384 __composite_unbind(gadget, true);
1385}
1386
1383static void update_unchanged_dev_desc(struct usb_device_descriptor *new, 1387static void update_unchanged_dev_desc(struct usb_device_descriptor *new,
1384 const struct usb_device_descriptor *old) 1388 const struct usb_device_descriptor *old)
1385{ 1389{
@@ -1488,7 +1492,7 @@ static int composite_bind(struct usb_gadget *gadget,
1488 return 0; 1492 return 0;
1489 1493
1490fail: 1494fail:
1491 composite_unbind(gadget); 1495 __composite_unbind(gadget, false);
1492 return status; 1496 return status;
1493} 1497}
1494 1498