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>
Wed, 22 Jun 2016 11:27:46 +0000 (19:27 +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://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
v4.8-clk/next commit 1d003eb0805ac5b549e76202a1e95da33f62cb9a)

Change-Id: Ia0161885786d6504fee7e76c6620df98bb2cdb21
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
drivers/clk/rockchip/clk-rk3228.c

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__);
        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;
        }
 
                return;
        }