Merge "usb: gadget: Do not disconnect unregistered dev"
This commit is contained in:
commit
2d320e52f7
1 changed files with 8 additions and 1 deletions
|
@ -1528,7 +1528,14 @@ static int android_setup(struct usb_gadget *gadget,
|
||||||
static void android_disconnect(struct usb_gadget *gadget)
|
static void android_disconnect(struct usb_gadget *gadget)
|
||||||
{
|
{
|
||||||
struct usb_composite_dev *cdev = get_gadget_data(gadget);
|
struct usb_composite_dev *cdev = get_gadget_data(gadget);
|
||||||
struct gadget_info *gi = container_of(cdev, struct gadget_info, cdev);
|
struct gadget_info *gi;
|
||||||
|
|
||||||
|
if (!cdev) {
|
||||||
|
pr_err("%s: gadget is not connected\n", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gi = container_of(cdev, struct gadget_info, cdev);
|
||||||
|
|
||||||
/* accessory HID support can be active while the
|
/* accessory HID support can be active while the
|
||||||
accessory function is not actually enabled,
|
accessory function is not actually enabled,
|
||||||
|
|
Loading…
Add table
Reference in a new issue