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)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 27 Mar 2016 11:03:35 +0000 (13:03 +0200)
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>
drivers/clk/rockchip/clk-rk3036.c
drivers/clk/rockchip/clk-rk3188.c
drivers/clk/rockchip/clk-rk3228.c
drivers/clk/rockchip/clk-rk3288.c
drivers/clk/rockchip/clk-rk3368.c

index c7c8260e1c66d3744876d8a54e9b9abc829cae7d..924f560dcf80e8a5681fba4c670524b2b20b01ee 100644 (file)
@@ -453,6 +453,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 0fcce2295b37a4199a1d822c5847b3b1f4a7c584..d0e722a0e8cff9afb79f7c22535042fe2332ce61 100644 (file)
@@ -773,6 +773,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 c112b2f952246e2c5a64743821ddb9bda6cab6ff..016bdb0b793ab94501fa59f1e185cf3c9f44dc87 100644 (file)
@@ -640,6 +640,7 @@ static void __init rk3228_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 d1031d1149ce3d4adbdf1889f1ebb2b15daef9f3..39af05a589b3c59a25902e83bf660ce7d409b7ca 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 3121414cfd63f2adafcd894e0269269f086c8bea..6cb474c593e7b111fa9da58e93bce5412b586422 100644 (file)
@@ -875,6 +875,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;
        }