From patchwork Tue Aug 27 21:28:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 270276 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 475462C0095 for ; Wed, 28 Aug 2013 08:43:53 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEQrs-0008KV-Q6; Tue, 27 Aug 2013 21:32:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEQr7-00066L-7j; Tue, 27 Aug 2013 21:31:17 +0000 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEQog-0005oo-9a for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2013 21:29:04 +0000 Received: by mail-ea0-f176.google.com with SMTP id q16so2495852ead.7 for ; Tue, 27 Aug 2013 14:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DImAJVz+Uhw34NhTNhLzMVBLy1MxGiZCL666AcCnlQ0=; b=nqlxKJT9M+Ct/n+aD4GqjHYZLTWlNGflIgdoRH2z++hXn7hKttLWCcrQMaUW0LyeJ/ SGljjn/TwDPGKzkcV/BcsgmyUm4tTLHHHDQ5loi48hu3+CyrXHrf7xxVcDfGGOh0PCdV CA4svZR1bKa6r+p8JfnHypmHDOra0V++F5XZepvnT29NfNBJU0/KmrmO+I6orsYmRecc aI2ESeoOwttMMmei/gmknV5ZQQelZYeBXrB/mFRGV+LSfQmYG6vQjHcAl5zbyEAWMEhy Morbap3X7X3G646bzo5jIMto2R06mAMVIn8HJ3XwPgsfx0BnBBZwW2Z37szikre15Po5 RNfA== X-Received: by 10.15.48.197 with SMTP id h45mr37747806eew.0.1377638904272; Tue, 27 Aug 2013 14:28:24 -0700 (PDT) Received: from topkick.lan (dslc-082-083-214-189.pools.arcor-ip.net. [82.83.214.189]) by mx.google.com with ESMTPSA id d8sm32068860eeh.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Aug 2013 14:28:22 -0700 (PDT) Received: from picnic.unix.mst.uni-hannover.de (firewall.mst.uni-hannover.de [130.75.30.51]) by topkick.lan (Postfix) with ESMTPSA id D5F03605DE; Tue, 27 Aug 2013 23:25:32 +0200 (CEST) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH RFC v2 08/16] ARM: mxs: remove custom .init_time hook Date: Tue, 27 Aug 2013 23:28:02 +0200 Message-Id: <1377638890-371-9-git-send-email-sebastian.hesselbarth@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1376964271-22715-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1376964271-22715-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130827_172847_058813_A79E5CE5 X-CRM114-Status: GOOD ( 13.56 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sebastian.hesselbarth[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Russell King , Arnd Bergmann , linux-kernel@vger.kernel.org, Mike Turquette , Shawn Guo , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This patch converts clk-imx2[38] clocksource_of_init compatible init associated with fsl,imx2[38]-clkctrl. With arch/arm calling of_clk_init(NULL) from time_init(), we can now also remove custom .init_time hooks. Signed-off-by: Sebastian Hesselbarth Acked-by: Mike Turquette --- Cc: Shawn Guo Cc: Mike Turquette Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-mxs/mach-mxs.c | 13 ------------- drivers/clk/mxs/clk-imx23.c | 16 +++++++--------- drivers/clk/mxs/clk-imx28.c | 16 +++++++--------- include/linux/clk/mxs.h | 2 -- 4 files changed, 14 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 98f6e2a..cc511a4 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -13,8 +13,6 @@ #include #include #include -#include -#include #include #include #include @@ -490,16 +488,6 @@ static void mxs_restart(enum reboot_mode mode, const char *cmd) soft_restart(0); } -static void __init mxs_timer_init(void) -{ - if (of_machine_is_compatible("fsl,imx23")) - mx23_clocks_init(); - else - mx28_clocks_init(); - of_clk_init(NULL); - clocksource_of_init(); -} - static const char *mxs_dt_compat[] __initdata = { "fsl,imx28", "fsl,imx23", @@ -508,7 +496,6 @@ static const char *mxs_dt_compat[] __initdata = { DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") .handle_irq = icoll_handle_irq, - .init_time = mxs_timer_init, .init_machine = mxs_machine_init, .init_late = mxs_pm_init, .dt_compat = mxs_dt_compat, diff --git a/drivers/clk/mxs/clk-imx23.c b/drivers/clk/mxs/clk-imx23.c index c396fe3..7eb1d1a 100644 --- a/drivers/clk/mxs/clk-imx23.c +++ b/drivers/clk/mxs/clk-imx23.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -100,19 +101,17 @@ static enum imx23_clk clks_init_on[] __initdata = { cpu, hbus, xbus, emi, uart, }; -int __init mx23_clocks_init(void) +static void __init mx23_clocks_init(struct device_node *np) { - struct device_node *np; u32 i; + clkctrl = of_iomap(np, 0); + WARN_ON(!clkctrl); + np = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl"); digctrl = of_iomap(np, 0); WARN_ON(!digctrl); - np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl"); - clkctrl = of_iomap(np, 0); - WARN_ON(!clkctrl); - clk_misc_init(); clks[ref_xtal] = mxs_clk_fixed("ref_xtal", 24000000); @@ -162,7 +161,7 @@ int __init mx23_clocks_init(void) if (IS_ERR(clks[i])) { pr_err("i.MX23 clk %d: register failed with %ld\n", i, PTR_ERR(clks[i])); - return PTR_ERR(clks[i]); + return; } clk_data.clks = clks; @@ -171,6 +170,5 @@ int __init mx23_clocks_init(void) for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) clk_prepare_enable(clks[clks_init_on[i]]); - - return 0; } +CLK_OF_DECLARE(imx23_clkctrl, "fsl,imx23-clkctrl", mx23_clocks_init); diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index 4faf0af..12d3f3d 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -154,19 +155,17 @@ static enum imx28_clk clks_init_on[] __initdata = { cpu, hbus, xbus, emi, uart, }; -int __init mx28_clocks_init(void) +static void __init mx28_clocks_init(struct device_node *np) { - struct device_node *np; u32 i; + clkctrl = of_iomap(np, 0); + WARN_ON(!clkctrl); + np = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl"); digctrl = of_iomap(np, 0); WARN_ON(!digctrl); - np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl"); - clkctrl = of_iomap(np, 0); - WARN_ON(!clkctrl); - clk_misc_init(); clks[ref_xtal] = mxs_clk_fixed("ref_xtal", 24000000); @@ -239,7 +238,7 @@ int __init mx28_clocks_init(void) if (IS_ERR(clks[i])) { pr_err("i.MX28 clk %d: register failed with %ld\n", i, PTR_ERR(clks[i])); - return PTR_ERR(clks[i]); + return; } clk_data.clks = clks; @@ -250,6 +249,5 @@ int __init mx28_clocks_init(void) for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) clk_prepare_enable(clks[clks_init_on[i]]); - - return 0; } +CLK_OF_DECLARE(imx28_clkctrl, "fsl,imx28-clkctrl", mx28_clocks_init); diff --git a/include/linux/clk/mxs.h b/include/linux/clk/mxs.h index 90c30dc..5138a90 100644 --- a/include/linux/clk/mxs.h +++ b/include/linux/clk/mxs.h @@ -9,8 +9,6 @@ #ifndef __LINUX_CLK_MXS_H #define __LINUX_CLK_MXS_H -int mx23_clocks_init(void); -int mx28_clocks_init(void); int mxs_saif_clkmux_select(unsigned int clkmux); #endif