Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965082AbbENS4H (ORCPT ); Thu, 14 May 2015 14:56:07 -0400 Received: from mail-bn1bn0100.outbound.protection.outlook.com ([157.56.110.100]:25663 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964806AbbENS4E (ORCPT ); Thu, 14 May 2015 14:56:04 -0400 X-Greylist: delayed 939 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 May 2015 14:56:03 EDT Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Subbaraya Sundeep Bhatta To: CC: , , , Subbaraya Sundeep Bhatta Subject: [PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails Date: Fri, 15 May 2015 00:09:30 +0530 Message-ID: <1431628770-31653-2-git-send-email-sbhatta@xilinx.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1431628770-31653-1-git-send-email-sbhatta@xilinx.com> References: <1431628770-31653-1-git-send-email-sbhatta@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-7.5.0.1018-21544.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD053;1:4dl5cI3j2bJkcHt3LOFa+SKi342iljq2SG89p2mxhbTPmhSrtQv2Y1nx3XE/46+iPfC+dmh1ZqSbeAz6CsCZwYdCqBuqqBE3d3xOdi7uXHPWg1rJSnXi+inxvFJyWG+7m0wdAX07qsLanrecVlaquDdZJYzszAzVChgTzPt0bRK21FDKoXsyvi5GZYEImr/PahVi59m0i7HQoJFmRlaKkae2QaWY3UShG975Y9LQFnXWB9CiOBAB1H8Boa6nsbwwmwJM21jBJj/TBgVcmkHEijVeyuERJwDqPGzYLLrv0qdJeYzqgK9apjwl2Hx+1hHp X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(438002)(199003)(189002)(2351001)(229853001)(6806004)(103686003)(45336002)(46386002)(107886002)(106466001)(5001960100002)(110136002)(48376002)(46102003)(50986999)(76176999)(42186005)(63266004)(189998001)(47776003)(36386004)(92566002)(50226001)(36756003)(50466002)(62966003)(33646002)(77156002)(2950100001)(19580395003)(87936001)(52956003)(86362001)(19580405001)(107986001)(4001430100001)(90966001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1BFFO11HUB044;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1BFFO11HUB044;2:bTPM6yZu5VmJcoiNLq/EEgRzbDHD8Fu57ZU0zfon?= =?us-ascii?Q?Bxa+zZ3ZaGmVGD6Bfs87gQY0;2:FtUGUB/1vjjT2168uo2qy8UFOHAEeG7MO?= =?us-ascii?Q?2iBGjmjDDCv37vN9NMRm91keuyIAO0C4zkISsxJuLjS4m5/uvvnWCiS2PRZE?= =?us-ascii?Q?rqE/mh3MKR7uqzX/6XNrJEdZbI8OHCfj09bcZzSEyINhrfZ+634p8JLG7dh6?= =?us-ascii?Q?AFy1+1bDqRz7UdQ0ZGJtTmHs/XcWOs0KRV295Lrv3DLYR4mU7msi+sMoXM/+?= =?us-ascii?Q?ApJ9ofosSyhon0XNwkeNhqtp3S1ZpIwBTwFApRb9wD6;6:FcuvZ278AgATyP?= =?us-ascii?Q?dFh1JKCvBdi5JNvR4k7fLyNHtfocyw2j13VTdPzgjoZr+jcOeAT8FDSAUUTD?= =?us-ascii?Q?FgxQsAqUshrrPs2ybijv/A+G/kUiG10PocFnGDrFaYfXGjVn2J+qO0fF7fhM?= =?us-ascii?Q?ZPzLlcp9Oo6kOG0bHDUx3uhzAqUioiHwje3BUOoUQxotWI3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pN?= =?us-ascii?Q?KEIuZIhn5u6qnOjpWkKZ+s4VuCNvBsYRZt4rrP+jiDyhHLJuB1dHyquikSvW?= =?us-ascii?Q?SnuK7FZcpJdLjuenZstI0lDtNcRVh7W/MozbjsAZl7KQ=3D=3D;10:bgkbpi?= =?us-ascii?Q?Xn7rB6jwnDjolygFz4MjSfUg3kx/bMtwNHMc5HfujSNPZkITMLdyi8yIyGEU?= =?us-ascii?Q?cTcnH+IMtiDoYi6GGEfK123e1e+oydwBt5dFhnUAY=3D?= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1BFFO11HUB044; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1BFFO11HUB044;BCL:0;PCL:0;RULEID:;SRVR:BN1BFFO11HUB044; X-Forefront-PRVS: 0576145E86 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2015 18:40:22.2065 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1BFFO11HUB044 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1165 Lines: 37 When sending DEPCMD or DGCMD command fails return error to caller. Signed-off-by: Subbaraya Sundeep Bhatta --- 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 -- 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/