From: Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>
To: <balbi@ti.com>
Cc: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
Subject: [PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails
Date: Fri, 15 May 2015 00:09:30 +0530 [thread overview]
Message-ID: <1431628770-31653-2-git-send-email-sbhatta@xilinx.com> (raw)
In-Reply-To: <1431628770-31653-1-git-send-email-sbhatta@xilinx.com>
When sending DEPCMD or DGCMD command fails return error to caller.
Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>
---
drivers/usb/dwc3/gadget.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8946c32..55b5edc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -291,6 +291,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DGCMD_STATUS(reg));
+ if (DWC3_DGCMD_STATUS(reg))
+ return -EINVAL;
return 0;
}
@@ -328,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;
}
--
1.7.4
next prev parent reply other threads:[~2015-05-14 18:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 18:39 [PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros Subbaraya Sundeep Bhatta
2015-05-14 18:39 ` Subbaraya Sundeep Bhatta [this message]
2015-05-14 18:47 ` Felipe Balbi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431628770-31653-2-git-send-email-sbhatta@xilinx.com \
--to=subbaraya.sundeep.bhatta@xilinx.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sbhatta@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®