From patchwork Wed Apr 15 14:26:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 6221021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 754369F1C4 for ; Wed, 15 Apr 2015 14:33:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAAA6201FA for ; Wed, 15 Apr 2015 14:33:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE0FB201F2 for ; Wed, 15 Apr 2015 14:33:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YiOL3-0003un-77; Wed, 15 Apr 2015 14:30:49 +0000 Received: from mail-bn1on0136.outbound.protection.outlook.com ([157.56.110.136] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YiOKG-0002NR-Pr for linux-arm-kernel@lists.infradead.org; Wed, 15 Apr 2015 14:30:01 +0000 Received: from CO2PR03CA0048.namprd03.prod.outlook.com (10.141.194.175) by BLUPR03MB1347.namprd03.prod.outlook.com (0.163.80.25) with Microsoft SMTP Server (TLS) id 15.1.130.23; Wed, 15 Apr 2015 14:29:36 +0000 Received: from BN1BFFO11FD026.protection.gbl (2a01:111:f400:7c10::1:187) by CO2PR03CA0048.outlook.office365.com (2a01:111:e400:1414::47) with Microsoft SMTP Server (TLS) id 15.1.130.23 via Frontend Transport; Wed, 15 Apr 2015 14:29:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD026.mail.protection.outlook.com (10.58.144.89) with Microsoft SMTP Server (TLS) id 15.1.148.11 via Frontend Transport; Wed, 15 Apr 2015 14:29:35 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t3FETK16031785; Wed, 15 Apr 2015 07:29:31 -0700 From: Dong Aisheng To: Subject: [PATCH RFC v1 3/5] clk: remove unneeded __clk_enable and __clk_disable Date: Wed, 15 Apr 2015 22:26:37 +0800 Message-ID: <1429107999-24413-4-git-send-email-aisheng.dong@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429107999-24413-1-git-send-email-aisheng.dong@freescale.com> References: <1429107999-24413-1-git-send-email-aisheng.dong@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(189002)(199003)(50986999)(19580395003)(48376002)(50466002)(47776003)(19580405001)(6806004)(76176999)(33646002)(50226001)(87936001)(110136001)(85426001)(104016003)(86362001)(92566002)(77096005)(105606002)(106466001)(36756003)(46102003)(2950100001)(229853001)(62966003)(77156002)(2351001)(4001430100001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1347; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1347; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BLUPR03MB1347; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1347; X-Forefront-PRVS: 0547116B72 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2015 14:29:35.3865 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1347 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150415_073001_043325_D68CEA6F X-CRM114-Status: UNSURE ( 8.10 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: Ranjani.Vaidyanathan@freescale.com, b20596@freescale.com, mturquette@linaro.org, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, r64343@freescale.com, b20788@freescale.com, shawn.guo@linaro.org, b29396@freescale.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 The only thing __clk_enable/__clk_disable does is NULL pointer checking of clk except calling clk_core_{enable|disable} which is already handled by clk_core_{enable|disable}. So remove this unneeded function. Cc: Mike Turquette Cc: Stephen Boyd Signed-off-by: Dong Aisheng --- drivers/clk/clk.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 492644f..7af553d 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1023,14 +1023,6 @@ static void clk_core_disable(struct clk_core *clk) clk_core_disable(clk->parent); } -static void __clk_disable(struct clk *clk) -{ - if (!clk) - return; - - clk_core_disable(clk->core); -} - /** * clk_disable - gate a clock * @clk: the clk being gated @@ -1051,7 +1043,7 @@ void clk_disable(struct clk *clk) return; flags = clk_enable_lock(); - __clk_disable(clk); + clk_core_disable(clk->core); clk_enable_unlock(flags); } EXPORT_SYMBOL_GPL(clk_disable); @@ -1089,14 +1081,6 @@ static int clk_core_enable(struct clk_core *clk) return 0; } -static int __clk_enable(struct clk *clk) -{ - if (!clk) - return 0; - - return clk_core_enable(clk->core); -} - /** * clk_enable - ungate a clock * @clk: the clk being ungated @@ -1116,7 +1100,7 @@ int clk_enable(struct clk *clk) int ret; flags = clk_enable_lock(); - ret = __clk_enable(clk); + ret = clk_core_enable(clk->core); clk_enable_unlock(flags); return ret;