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 1ed30d25191dc96cad2f9c32ba5c77f7b14d6897..a0b1fb4da9ddb13f36fdd0ba0a5a867a1e027d68 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 b1214cba169279624f316dba1aab712cfd8f4a42..0f78d7353d17e8d950bb457247ffa9feb14ed2e5 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 8f8369f30600587dd19609b61e6afb9adf6f9fad..1196818a0fbd79460fb9b8cb39c0d21c922aa449 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 88bda27d554103225e9461dc582fd9a877c2a77d..03b426ba9b613a632f6847b48bf554024596ac5d 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 3a6add7f34bdcced44e1179b1e98354aca650730..1f152733c8fe87fa18ebc06829952f5b1c2e1d8f 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;
        }