clk: highbank: Migrate to clk_hw based registration and OF APIs
authorStephen Boyd <stephen.boyd@linaro.org>
Wed, 1 Jun 2016 23:15:02 +0000 (16:15 -0700)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 30 Jun 2016 19:25:28 +0000 (12:25 -0700)
Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers in this driver, allowing us to
move closer to a clear split of consumer and provider clk APIs.

Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk-highbank.c

index be3a21abb185a188e207d8dd35cb8146293779a0..727ed8e1bb726fd424f97427507abe6f46fe84a9 100644 (file)
@@ -275,7 +275,6 @@ static const struct clk_ops periclk_ops = {
 static __init struct clk *hb_clk_init(struct device_node *node, const struct clk_ops *ops)
 {
        u32 reg;
-       struct clk *clk;
        struct hb_clk *hb_clk;
        const char *clk_name = node->name;
        const char *parent_name;
@@ -308,13 +307,13 @@ static __init struct clk *hb_clk_init(struct device_node *node, const struct clk
 
        hb_clk->hw.init = &init;
 
-       clk = clk_register(NULL, &hb_clk->hw);
-       if (WARN_ON(IS_ERR(clk))) {
+       rc = clk_hw_register(NULL, &hb_clk->hw);
+       if (WARN_ON(rc)) {
                kfree(hb_clk);
                return NULL;
        }
-       rc = of_clk_add_provider(node, of_clk_src_simple_get, clk);
-       return clk;
+       rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &hb_clk->hw);
+       return hb_clk->hw.clk;
 }
 
 static void __init hb_pll_init(struct device_node *node)