mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
UPSTREAM: clk: rockchip: release io resource when failing to init clk
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user