mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "USB: configfs: Don't send DISCONNECT uevent during unbind"
This commit is contained in:
commit
7f7057d273
1 changed files with 6 additions and 1 deletions
|
|
@ -85,6 +85,7 @@ struct gadget_info {
|
|||
struct usb_composite_driver composite;
|
||||
struct usb_composite_dev cdev;
|
||||
bool use_os_desc;
|
||||
bool unbinding;
|
||||
char b_vendor_code;
|
||||
char qw_sign[OS_STRING_QW_SIGN_LEN];
|
||||
spinlock_t spinlock;
|
||||
|
|
@ -277,9 +278,12 @@ static int unregister_gadget(struct gadget_info *gi)
|
|||
if (!gi->composite.gadget_driver.udc_name)
|
||||
return -ENODEV;
|
||||
|
||||
gi->unbinding = true;
|
||||
ret = usb_gadget_unregister_driver(&gi->composite.gadget_driver);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
gi->unbinding = false;
|
||||
kfree(gi->composite.gadget_driver.udc_name);
|
||||
gi->composite.gadget_driver.udc_name = NULL;
|
||||
return 0;
|
||||
|
|
@ -1629,7 +1633,8 @@ static void android_disconnect(struct usb_gadget *gadget)
|
|||
acc_disconnect();
|
||||
#endif
|
||||
gi->connected = 0;
|
||||
schedule_work(&gi->work);
|
||||
if (!gi->unbinding)
|
||||
schedule_work(&gi->work);
|
||||
composite_disconnect(gadget);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue