UPSTREAM: clk: rockchip: release io resource when failing to init clk
authorShawn Lin <shawn.lin@rock-chips.com>
Sun, 13 Mar 2016 04:13:22 +0000 (12:13 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 15 Mar 2016 09:49:31 +0000 (17:49 +0800)
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>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
v4.7-clk/next commit 86609a6613c64ee9272da1fd2f578d4beab2174e)

Conflicts:

drivers/clk/rockchip/clk-rk3228.c
[zx: there is no rk3228 clock controller, and apply this patch for
clk-rk3366 manually.]

Change-Id: I2d73c90eb6f43150725c81417af37a6a562cd329
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
drivers/clk/rockchip/clk-rk3036.c
drivers/clk/rockchip/clk-rk3188.c
drivers/clk/rockchip/clk-rk3288.c
drivers/clk/rockchip/clk-rk3366.c
drivers/clk/rockchip/clk-rk3368.c

index 1ed30d2..a0b1fb4 100644 (file)
@@ -449,6 +449,7 @@ static void __init rk3036_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;
        }
 
index b1214cb..0f78d73 100644 (file)
@@ -771,6 +771,7 @@ static struct rockchip_clk_provider *__init rk3188_common_clk_init(struct device
        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 ERR_PTR(-ENOMEM);
        }
 
index 8f8369f..1196818 100644 (file)
@@ -893,6 +893,7 @@ static void __init rk3288_clk_init(struct device_node *np)
        ctx = rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS);
        if (IS_ERR(ctx)) {
                pr_err("%s: rockchip clk init failed\n", __func__);
+               iounmap(rk3288_cru_base);
                return;
        }
 
index 88bda27..03b426b 100644 (file)
@@ -811,6 +811,7 @@ static void __init rk3366_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;
        }
 
index 3a6add7..1f15273 100644 (file)
@@ -869,6 +869,7 @@ static void __init rk3368_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;
        }