usb: dwc3: gadget: return error if command sent to DEPCMD register fails
authorSubbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>
Thu, 21 May 2015 10:16:48 +0000 (15:46 +0530)
committerFelipe Balbi <balbi@ti.com>
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 <sbhatta@xilinx.com>
Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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;
                }