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

Commit 2913747e authored by Tarun Gupta's avatar Tarun Gupta
Browse files

usb: gadget: u_bam: do runtime_put even if BAM channel was not opened



gbam_disconnect_work returns without doing a put, in the case where
bam channel was not opened successfully. This leads to a runtime
mismatch and USB not entering LPM again. Fix this by making sure that
we do runtime_put in above mentioned case.

Change-Id: Ic05f0ddf7ede3ad680726b9360a5d26ebf35772a
Signed-off-by: default avatarTarun Gupta <tarung@codeaurora.org>
parent 925f5828
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1168,7 +1168,7 @@ static void gbam_disconnect_work(struct work_struct *w)

	if (!test_bit(BAM_CH_OPENED, &d->flags)) {
		pr_err("%s: Bam channel is not opened\n", __func__);
		return;
		goto exit;
	}

	msm_bam_dmux_close(d->id);
@@ -1177,6 +1177,7 @@ static void gbam_disconnect_work(struct work_struct *w)
	 * Decrement usage count which was incremented upon cable connect
	 * or cable disconnect in suspended state
	 */
exit:
	usb_gadget_autopm_put_async(port->gadget);
}