usb: dwc3: gadget: return error if command sent to DEPCMD register fails
authorSubbaraya Sundeep Bhatta <[email protected]>
Thu, 21 May 2015 10:16:48 +0000 (15:46 +0530)
committerFelipe Balbi <[email protected]>
Tue, 26 May 2015 15:39:29 +0000 (10:39 -0500)
We need to return error to caller if command is not sent to
controller succesfully.

Signed-off-by: Subbaraya Sundeep Bhatta <[email protected]>
Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
Cc: <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
drivers/usb/dwc3/gadget.c

index fcbe120ba8ce9f9751bacf7aba86689288f84213..55b5edc1911988653f709bd92aae227649371190 100644 (file)
@@ -330,6 +330,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
                        dwc3_trace(trace_dwc3_gadget,
                                        "Command Complete --> %d",
                                        DWC3_DEPCMD_STATUS(reg));
+                       if (DWC3_DEPCMD_STATUS(reg))
+                               return -EINVAL;
                        return 0;
                }