diff options
author | Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com> | 2015-05-21 15:46:48 +0530 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2015-10-22 09:20:02 +0800 |
commit | 272bc28a42deac776c1c45a88a90559c93a015c7 (patch) | |
tree | 075e46fbe869c780b3cfdab8c666e8838f50d839 /drivers | |
parent | 341b2be2ca6ef035e122c029282278b69409a0fa (diff) |
usb: dwc3: gadget: return error if command sent to DEPCMD register fails
commit 76e838c9f7765f9a6205b4d558d75a66104bc60d 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: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'drivers')
-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 b7f89268c0f4..b43c6f90b25f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -301,6 +301,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep, if (!(reg & DWC3_DEPCMD_CMDACT)) { dev_vdbg(dwc->dev, "Command Complete --> %d\n", DWC3_DEPCMD_STATUS(reg)); + if (DWC3_DEPCMD_STATUS(reg)) + return -EINVAL; return 0; } |