summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>2015-05-21 15:46:47 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-03 09:29:44 -0700
commit265f7f397d9e22c9dab190f568840e4885f0d081 (patch)
tree25b1d0a1edffce773db6c1732d962c4244ce3a3e
parent2b265a7d06ff7ded5821a2447c97f36b020e99af (diff)
usb: dwc3: gadget: return error if command sent to DGCMD register fails
commit 891b1dc022955d36cf4c0f42d383226a930db7ed upstream. We need to return error to caller if command is not sent to controller succesfully. Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com> Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support) Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 87f8fc63b3e1..be6fa45be101 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -319,6 +319,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, int 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;
}