ARM: mxs: remove custom .init_time hook
[firefly-linux-kernel-4.4.55.git] / drivers / clk / mxs / clk-imx28.c
index 4faf0afc44cd5a2ebe0761af3e8d1250ed6c2b77..a6c35010e4e5b1a61f8e802896bc15ad623bc74a 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/clk.h>
 #include <linux/clk/mxs.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
@@ -154,16 +155,16 @@ 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;
+       struct device_node *dcnp;
        u32 i;
 
-       np = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl");
-       digctrl = of_iomap(np, 0);
+       dcnp = of_find_compatible_node(NULL, NULL, "fsl,imx28-digctl");
+       digctrl = of_iomap(dcnp, 0);
        WARN_ON(!digctrl);
+       of_node_put(dcnp);
 
-       np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");
        clkctrl = of_iomap(np, 0);
        WARN_ON(!clkctrl);
 
@@ -239,7 +240,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 +251,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);