From patchwork Tue Feb 14 16:09:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Birsan X-Patchwork-Id: 9572211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC79460573 for ; Tue, 14 Feb 2017 16:26:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D163C1FFAD for ; Tue, 14 Feb 2017 16:26:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5917205A4; Tue, 14 Feb 2017 16:26:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 79DB81FFAD for ; Tue, 14 Feb 2017 16:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zmOlgIHiwOnEjvwvumDncwfidXFvrfliEATdiWSh8Dg=; b=pLKwj35jLyVPxU NCSiotx3b3B6AACZeagpVUeKYrMmjHmSgy7jTAQqBNmAFkBjALop09+HoiDFAGmu9spnm8uGnMQsF zU10oqj9ruli3iSeMQMfh/vn1qtJK9KP2Kh//CS4mIzPwehcPyoM7519iKeZgLmUxWFlD1cKF07tW PAKn/wbBHOxN8kdVrEER5l9CJ8yH76BPsvcnW23hAycrb3wz80q64Vf6f6JLYdCB6V8lJ4K0lcgpJ a2b61ptOrLH10c+sHFF0aCKgyN4AiGYglXb9W4i9H0R6W78OYM0/EzXZ9ZCQM7QT95GTc61iLndop YqO9StDrPdnct9SeaLpA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cdfwG-0003YC-06; Tue, 14 Feb 2017 16:26:48 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cdfjx-0004uw-7g for linux-arm-kernel@bombadil.infradead.org; Tue, 14 Feb 2017 16:14:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NyXeEwhBUZGylSrE08ilRJ6vao0+sBh7WL9QEU/7EjY=; b=mjv8AbbZfTOA9goF1IdQlP6GX RQzxaLMWrPBcvWYtkbuooy85JfXlRyRpcEMbTqahwud+JlrlN4JhLfI57YKvgY8jBSiuZTXWw4g4Q yChtyBrmHmUeAhq5GmsPTo8kZq5shS/8IlY4MhDtbSuhUg7auccKmFv7r4iMEjLH4gjIQs+k2e2Oj Opvb642SFdPD+5NyBtJa+QFcepAJ9QPtPuatFJOXqGRarq0489TgaphneJJVO7FlMUOCWtm6+OM/a Y02N/ks0QN1oDlRCEn5rK9nwwKBnJ2ZlLj2qkw96JGHM1jUMk8LLad4aUvRrHIlYRPwSnVmcblnWM DTgLWfYnw==; Received: from smtpout.microchip.com ([198.175.253.82] helo=email.microchip.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cdfga-0004wa-FL for linux-arm-kernel@lists.infradead.org; Tue, 14 Feb 2017 16:10:39 +0000 Received: from cristi-lnx.microchip.com (10.10.76.4) by chn-sv-exch06.mchp-main.com (10.10.76.107) with Microsoft SMTP Server id 14.3.181.6; Tue, 14 Feb 2017 09:10:11 -0700 From: To: , , , , , Subject: [PATCH 2/4 linux-next] usb: gadget: udc: atmel: Minor code cleanup Date: Tue, 14 Feb 2017 18:09:04 +0200 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170214_161036_660415_7A1E488A X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.brezillon@free-electrons.com, ludovic.desroches@atmel.com, alexandre.belloni@free-electrons.com, Cristian Birsan Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Cristian Birsan Minor code cleanup based on feedback received on mailinglist. Signed-off-by: Cristian Birsan --- drivers/usb/gadget/udc/atmel_usba_udc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index ce8bf8b..3becb28 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -321,7 +321,6 @@ static inline void usba_cleanup_debugfs(struct usba_udc *udc) static ushort fifo_mode; -/* "modprobe ... fifo_mode=1" etc */ module_param(fifo_mode, ushort, 0x0); MODULE_PARM_DESC(fifo_mode, "Endpoint configuration mode"); @@ -1076,11 +1075,9 @@ static int atmel_usba_start(struct usb_gadget *gadget, struct usb_gadget_driver *driver); static int atmel_usba_stop(struct usb_gadget *gadget); -static struct usb_ep *atmel_usba_match_ep( - struct usb_gadget *gadget, - struct usb_endpoint_descriptor *desc, - struct usb_ss_ep_comp_descriptor *ep_comp -) +static struct usb_ep *atmel_usba_match_ep(struct usb_gadget *gadget, + struct usb_endpoint_descriptor *desc, + struct usb_ss_ep_comp_descriptor *ep_comp) { struct usb_ep *_ep; struct usba_ep *ep; @@ -1100,7 +1097,6 @@ static struct usb_ep *atmel_usba_match_ep( ep = to_usba_ep(_ep); switch (usb_endpoint_type(desc)) { - case USB_ENDPOINT_XFER_CONTROL: break; @@ -1141,7 +1137,7 @@ static struct usb_ep *atmel_usba_match_ep( ep->udc->configured_ep++; } -return _ep; + return _ep; } static const struct usb_gadget_ops usba_udc_ops = { @@ -2089,8 +2085,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, while ((pp = of_get_next_child(np, pp))) udc->num_ep++; udc->configured_ep = 1; - } else + } else { udc->num_ep = usba_config_fifo_table(udc); + } eps = devm_kzalloc(&pdev->dev, sizeof(struct usba_ep) * udc->num_ep, GFP_KERNEL);