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

Commit 9b79e913 authored by Subbaraya Sundeep Bhatta's avatar Subbaraya Sundeep Bhatta Committed by Sasha Levin
Browse files

usb: dwc3: gadget: return error if command sent to DGCMD register fails



[ Upstream commit 891b1dc022955d36cf4c0f42d383226a930db7ed ]

We need to return error to caller if command is not sent to
controller succesfully.

Signed-off-by: default avatarSubbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Fixes: b09bb642 (usb: dwc3: gadget: implement Global Command support)
Cc: <stable@vger.kernel.org> #v3.5+
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent c966a8dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -289,6 +289,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
		if (!(reg & DWC3_DGCMD_CMDACT)) {
			dev_vdbg(dwc->dev, "Command Complete --> %d\n",
					DWC3_DGCMD_STATUS(reg));
			if (DWC3_DGCMD_STATUS(reg))
				return -EINVAL;
			return 0;
		}