From patchwork Mon Oct 20 10:45:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5104231 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 909BAC11AC for ; Mon, 20 Oct 2014 10:46:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1B0620176 for ; Mon, 20 Oct 2014 10:46:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D7B52201D3 for ; Mon, 20 Oct 2014 10:46:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753634AbaJTKqJ (ORCPT ); Mon, 20 Oct 2014 06:46:09 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:33978 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbaJTKpx (ORCPT ); Mon, 20 Oct 2014 06:45:53 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDQ000WOOP10M10@mailout4.w1.samsung.com>; Mon, 20 Oct 2014 11:48:37 +0100 (BST) X-AuditID: cbfec7f5-b7f956d000005ed7-41-5444e7deefb8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id AF.82.24279.ED7E4445; Mon, 20 Oct 2014 11:45:50 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NDQ009U7OK7MS20@eusync4.samsung.com>; Mon, 20 Oct 2014 11:45:50 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Felipe Balbi , Kyungmin Park , Robert Baldyga , Paul Zimmerman , Krzysztof Kozlowski Subject: [PATCH v2 05/10] usb: dwc2/gadget: move setting last reset time to s3c_hsotg_core_init Date: Mon, 20 Oct 2014 12:45:35 +0200 Message-id: <1413801940-31086-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1413801940-31086-1-git-send-email-m.szyprowski@samsung.com> References: <1413801940-31086-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t/xa7r3nruEGPzpEbI4eL/e4vULQ4uz TW/YLWac38dksWhZK7PF2iN32S22T5nOZPHg8E52Bw6Pvi2rGD227P/M6HH8xnYmj8+b5AJY orhsUlJzMstSi/TtErgy5jzcwl7wnqviU9tnpgbGFxxdjBwcEgImEg139boYOYFMMYkL99az dTFycQgJLGWUeHZiGQuE08ck0TDnAhNIFZuAoUTX2y42EFtEwEFiydI7YDazwE9GiclTbUBs YYFEiVkf/oPVswioSpxY/YERxOYV8JCYemktG8Q2OYn/L1eA1XAKeEq8eTENrEYIqGbT8pcs Exh5FzAyrGIUTS1NLihOSs810itOzC0uzUvXS87P3cQICaivOxiXHrM6xCjAwajEw7vDzCVE iDWxrLgy9xCjBAezkghv922gEG9KYmVValF+fFFpTmrxIUYmDk6pBsa9j3afYtv04Ev/pMP/ 8wQtjlxjcj/K+UfrxPXvNw7XSBtP9Pi20N5utnzukdiwFqOJqdfEz/Jvk12+IOuJjNb2fc8+ P9oTqcq3wHqt1u1twY0Cs78zf+kO63r7JbbwyD4n7tlLpeYtdDn84Za57Yas9/MfXptzxPNi rvvjCVGloX+U9Hi2JhTdV2Ipzkg01GIuKk4EANU8KrMGAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch removes duplicated code and sets last_rst variable in the function which does the hardware reset. Signed-off-by: Marek Szyprowski Acked-by: Paul Zimmerman --- drivers/usb/dwc2/gadget.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index fd52a8b23649..c1dad46bbbdd 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2247,6 +2247,8 @@ static void s3c_hsotg_core_init(struct s3c_hsotg *hsotg) /* must be at-least 3ms to allow bus to see disconnect */ mdelay(3); + hsotg->last_rst = jiffies; + /* remove the soft-disconnect and let's go */ __bic32(hsotg->regs + DCTL, DCTL_SFTDISCON); } @@ -2347,7 +2349,6 @@ irq_retry: -ECONNRESET, true); s3c_hsotg_core_init(hsotg); - hsotg->last_rst = jiffies; } } } @@ -2908,7 +2909,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget, goto err; } - hsotg->last_rst = jiffies; dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name); return 0; @@ -3667,7 +3667,6 @@ static int s3c_hsotg_resume(struct platform_device *pdev) } spin_lock_irqsave(&hsotg->lock, flags); - hsotg->last_rst = jiffies; s3c_hsotg_phy_enable(hsotg); s3c_hsotg_core_init(hsotg); spin_unlock_irqrestore(&hsotg->lock, flags);