From patchwork Tue Aug 20 17:31:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2847258 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3312D9F2F4 for ; Tue, 20 Aug 2013 17:53:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D5902054D for ; Tue, 20 Aug 2013 17:53:52 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CA8220523 for ; Tue, 20 Aug 2013 17:53:50 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBpp4-0004NN-WD; Tue, 20 Aug 2013 17:34:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBpoQ-00030C-7e; Tue, 20 Aug 2013 17:33:46 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VBpnA-0002pu-9e for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2013 17:32:30 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MRU0051UBD7UJE0@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2013 18:32:01 +0100 (BST) X-AuditID: cbfec7f5-b7f5f6d00000105f-ab-5213a811f047 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 8A.24.04191.118A3125; Tue, 20 Aug 2013 18:32:01 +0100 (BST) Received: from amdc1227.digital.local ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MRU00779BD55310@eusync3.samsung.com>; Tue, 20 Aug 2013 18:32:01 +0100 (BST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/16] clk: samsung: Modify _get_rate() helper to use __clk_lookup() Date: Tue, 20 Aug 2013 19:31:32 +0200 Message-id: <1377019903-14614-6-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.3.2 In-reply-to: <1377019903-14614-1-git-send-email-t.figa@samsung.com> References: <1377019903-14614-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t/xq7qCK4SDDH681LWY91nWYv6Rc6wW Z5cdZLPof7OQ1aJ3wVU2i7NNb9gtNj2+xmox4/w+Joul1y8yWTydcJHNYsL0tSwWh1ccYLJ4 dbCNxWL9jNcsFps3TWW2ODZjCaNF+9+9bBZzpr9jchDyWDNvDaPHgs9X2D1mN1xk8bjc18vk cefaHjaPd+fOsXtsXlLv0bdlFaPH501yHhvnhgZwRXHZpKTmZJalFunbJXBlbOrax1ZwR6Ti xMd7bA2MRwS7GDk5JARMJPovzmSEsMUkLtxbzwZiCwksZZS4dc6ri5ELyO5jkpix8CQ7SIJN QE3ic8MjsCIRAQ2JKV2P2UGKmAUWs0rcuvgSbJKwQJjE0wknwWwWAVWJLee6wRp4BZwkZhw5 wwSxTUFi2Ze1zCA2p4CzxIZFS1khNjtJdO5bxDaBkXcBI8MqRtHU0uSC4qT0XCO94sTc4tK8 dL3k/NxNjJCA/7qDcekxq0OMAhyMSjy8HCXCQUKsiWXFlbmHGCU4mJVEeLdlAIV4UxIrq1KL 8uOLSnNSiw8xMnFwSjUwnrv043azamOc09mq/d2pd+P0Ts+aJOXZ/fbF8c93L3ycHbW9ZG/g t6kLLylNmblda7XU0t+JnZE7UvZGSmmnPdMuWSG0T6ibX5Fv4a950Tozfk6zP+PXZNmlUi9w uyIqLsR6umtOuEDRzCN3Nin6r2R3eX2d8dAuT7PSo7cV9cQEeewsN4aeVGIpzkg01GIuKk4E AGTdzpNWAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130820_133228_485647_B6EA9D97 X-CRM114-Status: GOOD ( 11.87 ) X-Spam-Score: -9.7 (---------) Cc: Mark Rutland , devicetree@vger.kernel.org, Yadwinder Singh Brar , linux-samsung-soc@vger.kernel.org, Mike Turquette , Pawel Moll , Stephen Warren , Tomasz Figa , Daniel Lezcano , Doug Anderson , Rob Herring , Kyungmin Park , Kukjin Kim , Thomas Abraham , Kumar Gala , Thomas Gleixner , Tushar Behera X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 There is no need to use clkdev inside the clock driver to retrieve the clocks for internal use. Instead __clk_lookup() helper can be used to look up clocks by their platform name. This patch modifies the behavior of _get_rate() helper to look up clocks by platform name and adjusts all users of it to pass platform names instead of clkdev aliases. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- drivers/clk/samsung/clk-exynos4.c | 4 ++-- drivers/clk/samsung/clk-exynos5440.c | 2 +- drivers/clk/samsung/clk.c | 10 ++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 7de0769..a974a56 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c @@ -1096,9 +1096,9 @@ static void __init exynos4_clk_init(struct device_node *np, pr_info("%s clocks: sclk_apll = %ld, sclk_mpll = %ld\n" "\tsclk_epll = %ld, sclk_vpll = %ld, arm_clk = %ld\n", exynos4_soc == EXYNOS4210 ? "Exynos4210" : "Exynos4x12", - _get_rate("sclk_apll"), _get_rate("mout_mpll"), + _get_rate("sclk_apll"), _get_rate("sclk_mpll"), _get_rate("sclk_epll"), _get_rate("sclk_vpll"), - _get_rate("armclk")); + _get_rate("arm_clk")); } diff --git a/drivers/clk/samsung/clk-exynos5440.c b/drivers/clk/samsung/clk-exynos5440.c index 4ef38e0..f865894 100644 --- a/drivers/clk/samsung/clk-exynos5440.c +++ b/drivers/clk/samsung/clk-exynos5440.c @@ -132,7 +132,7 @@ static void __init exynos5440_clk_init(struct device_node *np) samsung_clk_register_gate(exynos5440_gate_clks, ARRAY_SIZE(exynos5440_gate_clks)); - pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("armclk")); + pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("arm_clk")); pr_info("exynos5440 clock initialization complete\n"); } CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index cd3c40a..f503f32 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -307,14 +307,12 @@ void __init samsung_clk_of_register_fixed_ext( unsigned long _get_rate(const char *clk_name) { struct clk *clk; - unsigned long rate; - clk = clk_get(NULL, clk_name); - if (IS_ERR(clk)) { + clk = __clk_lookup(clk_name); + if (!clk) { pr_err("%s: could not find clock %s\n", __func__, clk_name); return 0; } - rate = clk_get_rate(clk); - clk_put(clk); - return rate; + + return clk_get_rate(clk); }