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

Commit 16cac5d0 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Do not disconnect unregistered dev" into msm-4.8

parents ea6ae44c cb0304a9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1521,7 +1521,14 @@ static int android_setup(struct usb_gadget *gadget,
static void android_disconnect(struct usb_gadget *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 function is not actually enabled,