clk: sunxi: Fix checking return value of clk_register_[composite|factors]
authorAxel Lin <axel.lin@ingics.com>
Fri, 12 Jul 2013 08:15:15 +0000 (16:15 +0800)
committerMike Turquette <mturquette@linaro.org>
Thu, 8 Aug 2013 22:57:27 +0000 (15:57 -0700)
clk_register_composite() and clk_register_factors() return ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/sunxi/clk-sunxi.c

index 412912bbba53c6806f58cb7dc1d4a8daa45d084e..02e440beb3d346bc532a422fc3ba4a385678c823 100644 (file)
@@ -64,7 +64,7 @@ static void __init sunxi_osc_clk_setup(struct device_node *node)
                        &gate->hw, &clk_gate_ops,
                        CLK_IS_ROOT);
 
-       if (clk) {
+       if (!IS_ERR(clk)) {
                of_clk_add_provider(node, of_clk_src_simple_get, clk);
                clk_register_clkdev(clk, clk_name, NULL);
        }
@@ -221,7 +221,7 @@ static void __init sunxi_factors_clk_setup(struct device_node *node,
        clk = clk_register_factors(NULL, clk_name, parent, 0, reg,
                                   data->table, data->getter, &clk_lock);
 
-       if (clk) {
+       if (!IS_ERR(clk)) {
                of_clk_add_provider(node, of_clk_src_simple_get, clk);
                clk_register_clkdev(clk, clk_name, NULL);
        }