diff mbox

[3/7] clk: rockchip: release io resource when rk3036_clk_init failed

Message ID 1457799925-3142-1-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Lin March 12, 2016, 4:25 p.m. UTC
We should call iounmap to relase reg_base since it's not going
to be used any more.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/clk/rockchip/clk-rk3036.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Heiko Stuebner March 12, 2016, 4:48 p.m. UTC | #1
Hi Shawn,

Am Sonntag, 13. März 2016, 00:25:25 schrieb Shawn Lin:
> We should call iounmap to relase reg_base since it's not going
> to be used any more.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

I see that change for rk3036, rk3188(+rk3066) and rk3368.
But it looks like rk3228 and rk3288 should also get that, or am I just 
overlooking something?

Also, I think we can fold these changes into one patch, as it's the completely 
same addition for all clock-drivers.


Heiko

> ---
> 
>  drivers/clk/rockchip/clk-rk3036.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/rockchip/clk-rk3036.c
> b/drivers/clk/rockchip/clk-rk3036.c index 8c683cc..284c36f 100644
> --- a/drivers/clk/rockchip/clk-rk3036.c
> +++ b/drivers/clk/rockchip/clk-rk3036.c
> @@ -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;
>  	}
Shawn Lin March 13, 2016, 1:49 a.m. UTC | #2
? 2016/3/13 0:48, Heiko Stübner ??:
> Hi Shawn,
>
> Am Sonntag, 13. März 2016, 00:25:25 schrieb Shawn Lin:
>> We should call iounmap to relase reg_base since it's not going
>> to be used any more.
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>
> I see that change for rk3036, rk3188(+rk3066) and rk3368.
> But it looks like rk3228 and rk3288 should also get that, or am I just
> overlooking something?

My fault, we need to do that for 3228/3288 as well.
Sorry for my slippy finger. I assign wrong patch-numbers to my
script.

I will squash up patch[3/7],[4/7],[5/7] as well as for 3228/3288, and
resend a separate patch for it.

>
> Also, I think we can fold these changes into one patch, as it's the completely
> same addition for all clock-drivers.
>
>
> Heiko
>
>> ---
>>
>>   drivers/clk/rockchip/clk-rk3036.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/clk/rockchip/clk-rk3036.c
>> b/drivers/clk/rockchip/clk-rk3036.c index 8c683cc..284c36f 100644
>> --- a/drivers/clk/rockchip/clk-rk3036.c
>> +++ b/drivers/clk/rockchip/clk-rk3036.c
>> @@ -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;
>>   	}
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>
diff mbox

Patch

diff --git a/drivers/clk/rockchip/clk-rk3036.c b/drivers/clk/rockchip/clk-rk3036.c
index 8c683cc..284c36f 100644
--- a/drivers/clk/rockchip/clk-rk3036.c
+++ b/drivers/clk/rockchip/clk-rk3036.c
@@ -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;
 	}