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

Commit bef5e6f9 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 71833319 188b6db5
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -1258,7 +1258,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;
}
@@ -3441,6 +3441,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) {
@@ -3473,13 +3475,8 @@ 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");
}