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

Commit a0de1430 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: android: Call PM APIs if configured and suspended are true"

parents 946817f4 d4e5b324
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -530,9 +530,13 @@ static void android_disable(struct android_dev *dev)
{
	struct usb_composite_dev *cdev = dev->cdev;
	struct android_configuration *conf;
	bool do_put = false;

	if (dev->disable_depth++ == 0) {
		if (cdev->suspended && cdev->config) {
			usb_gadget_autopm_get(cdev->gadget);
			do_put = true;
		}
		if (gadget_is_dwc3(cdev->gadget)) {
			/* Cancel pending control requests */
			usb_ep_dequeue(cdev->gadget->ep0, cdev->req);
@@ -551,6 +555,7 @@ static void android_disable(struct android_dev *dev)
			list_for_each_entry(conf, &dev->configs, list_item)
				usb_remove_config(cdev, &conf->usb_config);
		}
		if (do_put)
			usb_gadget_autopm_put_async(cdev->gadget);
	}
}