]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 11 Aug 2015 08:57:37 +0000 (09:57 +0100)
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: Luis Henriques <luis.henriques@canonical.com>
drivers/usb/dwc3/gadget.c

index 18d2ffcc462b6bb8934021a2b91d3be10ad15919..8946e34cef634c27ec2026da568fdc8f9c43b4f2 100644 (file)
@@ -414,6 +414,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;
                }