]> git.karo-electronics.de Git - linux-beck.git/commitdiff
clk: rockchip: disable alt_parent clk in err cases when registering cpuclk
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 15 Feb 2016 03:33:15 +0000 (11:33 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 15 Feb 2016 21:32:00 +0000 (22:32 +0100)
Add clk_disable_unprepare to handle cpuclk->alt_parent if
rockchip_clk_register_cpuclk fails.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/clk/rockchip/clk-cpu.c

index d07374f48caf7ee6d8c5b8f6ed82cca089e964d0..68a2a87717d27c73065ab3011789257c9293d21e 100644 (file)
@@ -290,14 +290,14 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
                pr_err("%s: could not lookup parent clock %s\n",
                       __func__, parent_names[0]);
                ret = -EINVAL;
-               goto free_cpuclk;
+               goto free_alt_parent;
        }
 
        ret = clk_notifier_register(clk, &cpuclk->clk_nb);
        if (ret) {
                pr_err("%s: failed to register clock notifier for %s\n",
                                __func__, name);
-               goto free_cpuclk;
+               goto free_alt_parent;
        }
 
        if (nrates > 0) {
@@ -326,6 +326,8 @@ free_rate_table:
        kfree(cpuclk->rate_table);
 unregister_notifier:
        clk_notifier_unregister(clk, &cpuclk->clk_nb);
+free_alt_parent:
+       clk_disable_unprepare(cpuclk->alt_parent);
 free_cpuclk:
        kfree(cpuclk);
        return ERR_PTR(ret);