From patchwork Fri Aug 21 12:38:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7051571 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C4396C05AC for ; Fri, 21 Aug 2015 12:40:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7A1A2063D for ; Fri, 21 Aug 2015 12:40:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08AF22057F for ; Fri, 21 Aug 2015 12:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753683AbbHUMjn (ORCPT ); Fri, 21 Aug 2015 08:39:43 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:22196 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbbHUMjT (ORCPT ); Fri, 21 Aug 2015 08:39:19 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTF0092UN5EL920@mailout3.w1.samsung.com>; Fri, 21 Aug 2015 13:39:14 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-31-55d71bf21b72 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 29.D8.04846.2FB17D55; Fri, 21 Aug 2015 13:39:14 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NTF00L5CN50J880@eusync2.samsung.com>; Fri, 21 Aug 2015 13:39:14 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Robert Baldyga , John Youn , Krzysztof Kozlowski , Kukjin Kim Subject: [PATCH 5/7] usb: dwc2: remove non-functional clock gating Date: Fri, 21 Aug 2015 14:38:41 +0200 Message-id: <1440160723-6636-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1440160723-6636-1-git-send-email-m.szyprowski@samsung.com> References: <1440160723-6636-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t/xK7qfpK+HGuxepWux+/QlRovXLwwt +h+/Zra4vGsOm8WM8/uYLBYta2W2WHvkLrvFg8M72R04PDat6mTz6NuyitFjy/7PjB6fN8kF sERx2aSk5mSWpRbp2yVwZay5MYutoI2v4vXWDrYGxi/cXYycHBICJhKH1/cxQthiEhfurWfr YuTiEBJYyigxufkVlNPEJLHy20E2kCo2AUOJrrddYLaIQIJE3/J+MJtZ4AyjxINvRV2MHBzC Ak4SdzZVg4RZBFQldp3fBLaAV8Bd4t2hfSwQy+Qk/r9cwQRicwp4SOy5OA+sRgioZvPL04wT GHkXMDKsYhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAgJqS87GBcfszrEKMDBqMTDOyPyWqgQ a2JZcWXuIUYJDmYlEV7rF0Ah3pTEyqrUovz4otKc1OJDjNIcLErivHN3vQ8REkhPLEnNTk0t SC2CyTJxcEo1MOq2CKeYyS/1mK26MOnlLX6ZSNd1Wi/+ss72uOPVEL8l4lz8H9tzG26XOAay 6e/eFhKp2td+e/36nRbvp3TbtExasvdyLWPFpzwHyemTW/5v/8By9Ovi9LS4g0E8L3afkV33 zs/jTWWyyt7r668nbfsUcbKfya1t2ZmrcfzSInOMAqZtqTyktVWJpTgj0VCLuag4EQDokq5K JQIAAA== 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=-7.7 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 During typical gadget operation, dwc2 clock was enabled 3 times: from dwc2_gadget_init(), s3c_hsotg_udc_start() and s3c_hsotg_pullup(), and then disabled in s3c_hsotg_pullup(), s3c_hsotg_udc_stop() and s3c_hsotg_remove(). This really makes no sense, so leave clock control code only in dwc2_gadget_init/remove functions. Signed-off-by: Marek Szyprowski --- drivers/usb/dwc2/gadget.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 47960787f572..bccb60fcdd70 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -3068,8 +3068,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget, hsotg->gadget.dev.of_node = hsotg->dev->of_node; hsotg->gadget.speed = USB_SPEED_UNKNOWN; - clk_enable(hsotg->clk); - ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); if (ret) { @@ -3139,8 +3137,6 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget) regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); - clk_disable(hsotg->clk); - mutex_unlock(&hsotg->init_mutex); return 0; @@ -3174,7 +3170,6 @@ static int s3c_hsotg_pullup(struct usb_gadget *gadget, int is_on) mutex_lock(&hsotg->init_mutex); spin_lock_irqsave(&hsotg->lock, flags); if (is_on) { - clk_enable(hsotg->clk); hsotg->enabled = 1; s3c_hsotg_core_init_disconnected(hsotg, false); s3c_hsotg_core_connect(hsotg); @@ -3182,7 +3177,6 @@ static int s3c_hsotg_pullup(struct usb_gadget *gadget, int is_on) s3c_hsotg_core_disconnect(hsotg); s3c_hsotg_disconnect(hsotg); hsotg->enabled = 0; - clk_disable(hsotg->clk); } hsotg->gadget.speed = USB_SPEED_UNKNOWN;