Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334129

[PATCH 1/6] clk: rockchip: handle alt_parent in err cases when registering cpuclk

From Shawn Lin <shawn.lin@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH 1/6] clk: rockchip: handle alt_parent in err cases when registering cpuclk
Date 2016-02-15 04:40 +0100
Message-ID <r2ib0-3Gn-27@gated-at.bofh.it> (permalink)
References <r2iaZ-3Gn-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>

---

 drivers/clk/rockchip/clk-cpu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/rockchip/clk-cpu.c b/drivers/clk/rockchip/clk-cpu.c
index d07374f..68a2a87 100644
--- a/drivers/clk/rockchip/clk-cpu.c
+++ b/drivers/clk/rockchip/clk-cpu.c
@@ -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);
-- 
2.3.7

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Some trivial fixes for rockchip clk/pm stuff Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 04:40 +0100
  [PATCH 4/6] clk: rockchip: don't return NULL when registering mmc branch fails Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 04:40 +0100
    Re: [PATCH 4/6] clk: rockchip: don't return NULL when registering mmc branch fails Heiko Stuebner <heiko@sntech.de> - 2016-02-15 23:50 +0100
  [PATCH 1/6] clk: rockchip: handle alt_parent in err cases when registering cpuclk Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 04:40 +0100
    Re: [PATCH 1/6] clk: rockchip: handle alt_parent in err cases when registering cpuclk Heiko Stuebner <heiko@sntech.de> - 2016-02-15 22:40 +0100

csiph-web