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


Groups > linux.kernel > #1412662 > unrolled thread

[PATCH 1/2] clk: rockchip: release io resource when failing to init clk

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-06-03 03:00 +0200
Last post2016-06-03 15:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] clk: rockchip: release io resource when failing to init clk Shawn Lin <shawn.lin@rock-chips.com> - 2016-06-03 03:00 +0200
    Re: [PATCH 1/2] clk: rockchip: release io resource when failing to init clk Heiko Stübner <heiko@sntech.de> - 2016-06-03 15:50 +0200

#1412662 — [PATCH 1/2] clk: rockchip: release io resource when failing to init clk

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-06-03 03:00 +0200
Subject[PATCH 1/2] clk: rockchip: release io resource when failing to init clk
Message-ID<rFLCV-4Ha-5@gated-at.bofh.it>
We should call iounmap to relase reg_base since it's not going
to be used any more if failing to init clk.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/clk/rockchip/clk-rk3399.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/rockchip/clk-rk3399.c b/drivers/clk/rockchip/clk-rk3399.c
index b6742fa..37c74cb 100644
--- a/drivers/clk/rockchip/clk-rk3399.c
+++ b/drivers/clk/rockchip/clk-rk3399.c
@@ -1509,6 +1509,7 @@ static void __init rk3399_clk_init(struct device_node *np)
 	ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
 	if (IS_ERR(ctx)) {
 		pr_err("%s: rockchip clk init failed\n", __func__);
+		iounmap(reg_base);
 		return;
 	}
 
@@ -1562,6 +1563,7 @@ static void __init rk3399_pmu_clk_init(struct device_node *np)
 	ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS);
 	if (IS_ERR(ctx)) {
 		pr_err("%s: rockchip pmu clk init failed\n", __func__);
+		iounmap(reg_base);
 		return;
 	}
 
-- 
2.3.7

[toc] | [next] | [standalone]


#1413260

FromHeiko Stübner <heiko@sntech.de>
Date2016-06-03 15:50 +0200
Message-ID<rFXE6-3Ng-31@gated-at.bofh.it>
In reply to#1412662
Am Freitag, 3. Juni 2016, 08:54:18 schrieb Shawn Lin:
> We should call iounmap to relase reg_base since it's not going
> to be used any more if failing to init clk.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

applied to my clk-fixes branch for 4.7, after adding a line to the patch-
description explaining that this is really just missing on rk3399 (and after 
checking that the iounmaps are already present on the old clock-trees)


Thanks for catching this
Heiko

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web