diff options
| author | Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com> | 2015-05-21 15:46:47 +0530 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-08-26 19:30:05 +0200 |
| commit | 2d5c5aa05822ab86c110cc84b487dd8a707dc696 (patch) | |
| tree | 65332c8f90e15a4d8ea0d696264b4d5cf1ea46a1 | |
| parent | e24dc9872f503b4b3ca54cc8ddb7ed9d33ecd304 (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>
Signed-off-by: Stefan Guendhoer <stefan@guendhoer.com>
| -rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 87f8fc63b..be6fa45be 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; } |
