Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199936

[PATCH 3.12 062/123] usb: dwc3: gadget: return error if command sent to DGCMD register fails

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject [PATCH 3.12 062/123] usb: dwc3: gadget: return error if command sent to DGCMD register fails
Date Tue, 04 Aug 2015 16:50:03 +0200
Message-ID <pTLHt-552-55@gated-at.bofh.it> (permalink)
References <pTLHr-552-3@gated-at.bofh.it>
X-Original-To stable@vger.kernel.org
X-Amavis-Alert BAD HEADER SECTION, Duplicate header field: "References"
X-Mailer git-send-email 2.5.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>, Subbaraya Sundeep Bhatta <sbhatta@xilinx.com>, Felipe Balbi <balbi@ti.com>, Jiri Slaby <jslaby@suse.cz>
X-Original-Date Tue, 4 Aug 2015 16:40:06 +0200
X-Original-Message-ID <7c46398c17f37b0216d7236e089852572de7f761.1438699154.git.jslaby@suse.cz>
X-Original-References <fe2a2e06fd8af3a00d18691ffeb2b636f685bee4.1438699154.git.jslaby@suse.cz>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1199936

Show key headers only | View raw


From: Subbaraya Sundeep Bhatta <subbaraya.sundeep.bhatta@xilinx.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 891b1dc022955d36cf4c0f42d383226a930db7ed 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: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/usb/dwc3/gadget.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index d19564d0f79a..eb678c5300a6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -299,6 +299,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, int cmd, u32 param)
 		if (!(reg & DWC3_DGCMD_CMDACT)) {
 			dev_vdbg(dwc->dev, "Command Complete --> %d\n",
 					DWC3_DGCMD_STATUS(reg));
+			if (DWC3_DGCMD_STATUS(reg))
+				return -EINVAL;
 			return 0;
 		}
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.12 062/123] usb: dwc3: gadget: return error if command sent to DGCMD register fails Jiri Slaby <jslaby@suse.cz> - 2015-08-04 16:50 +0200

csiph-web