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

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

Merge "usb: gadget: ffs: Fix runtime PM usage count for multiple set_alt"

parents fc33732a dd11a247
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1404,7 +1404,7 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to)
		*to = p->data;
	}

	ffs_log("enter");
	ffs_log("exit");

	return res;
}
@@ -3633,6 +3633,8 @@ static int ffs_func_set_alt(struct usb_function *f,
	if (ffs->func) {
		ffs_func_eps_disable(ffs->func);
		ffs->func = NULL;
		/* matching put to allow LPM on disconnect */
		usb_gadget_autopm_put_async(ffs->gadget);
	}

	if (ffs->state == FFS_DEACTIVATED) {
@@ -3665,13 +3667,9 @@ static int ffs_func_set_alt(struct usb_function *f,

static void ffs_func_disable(struct usb_function *f)
{
	struct ffs_function *func = ffs_func_from_usb(f);
	struct ffs_data *ffs = func->ffs;

	ffs_log("enter");
	ffs_func_set_alt(f, 0, (unsigned)-1);
	/* matching put to allow LPM on disconnect */
	usb_gadget_autopm_put_async(ffs->gadget);

	ffs_log("exit");
}