Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461629 > unrolled thread

[v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2016-08-13 17:40 +0200
Last post2016-08-24 17:00 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-08-13 17:40 +0200
    Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization. Heiko Stübner <heiko@sntech.de> - 2016-08-23 18:20 +0200
      Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock  initialization. arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-08-24 16:30 +0200
        Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization. Heiko Stübner <heiko@sntech.de> - 2016-08-24 17:00 +0200

#1461629 — [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2016-08-13 17:40 +0200
Subject[v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.
Message-ID<s5Jct-38n-7@gated-at.bofh.it>
-check return of 'of_iomap'.if It's falied to remap then abort.

-Unmap a region obtained by remap. iounmap frees the mapping when failed
to allocate the memory.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/clk/rockchip/clk-rockchip.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk-rockchip.c b/drivers/clk/rockchip/clk-rockchip.c
index 4cf838d5..2c9bb81 100644
--- a/drivers/clk/rockchip/clk-rockchip.c
+++ b/drivers/clk/rockchip/clk-rockchip.c
@@ -49,14 +49,19 @@ static void __init rk2928_gate_clk_init(struct device_node *node)
 	}
 
 	reg = of_iomap(node, 0);
+	if (!reg)
+		return;
 
 	clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
-	if (!clk_data)
+	if (!clk_data) {
+		iounmap(reg);
 		return;
+	}
 
 	clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL);
 	if (!clk_data->clks) {
 		kfree(clk_data);
+		iounmap(reg);
 		return;
 	}
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1468676

FromHeiko Stübner <heiko@sntech.de>
Date2016-08-23 18:20 +0200
Message-ID<s9mAF-6kW-1@gated-at.bofh.it>
In reply to#1461629
Hi Arvind,

Am Samstag, 13. August 2016, 20:56:18 schrieb Arvind Yadav:
> -check return of 'of_iomap'.if It's falied to remap then abort.
> 
> -Unmap a region obtained by remap. iounmap frees the mapping when failed
> to allocate the memory.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/clk/rockchip/clk-rockchip.c | 7 ++++++-

I've applied the patch, after rewording both patch subject and message [0].

That driver is deprecated for quite some time, see
Documenation/devicetree/bindings/clock/rockchip.txt - so I'm hoping this is
more of a random find and you're not actually using it?


Thanks
Heiko

[0] https://git.kernel.org/cgit/linux/kernel/git/mmind/linux-rockchip.git/commit/?id=023a8280b8355a0aebe094299afec8d8b7b264cd

[toc] | [prev] | [next] | [standalone]


#1469489 — Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.

Fromarvind Yadav <arvind.yadav.cs@gmail.com>
Date2016-08-24 16:30 +0200
SubjectRe: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.
Message-ID<s9HlL-3tn-13@gated-at.bofh.it>
In reply to#1468676
yes, I am referring this code for clock control.

--Arvind


On Tuesday 23 August 2016 09:45 PM, Heiko Stübner wrote:
> Hi Arvind,
>
> Am Samstag, 13. August 2016, 20:56:18 schrieb Arvind Yadav:
>> -check return of 'of_iomap'.if It's falied to remap then abort.
>>
>> -Unmap a region obtained by remap. iounmap frees the mapping when failed
>> to allocate the memory.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>>   drivers/clk/rockchip/clk-rockchip.c | 7 ++++++-
> I've applied the patch, after rewording both patch subject and message [0].
>
> That driver is deprecated for quite some time, see
> Documenation/devicetree/bindings/clock/rockchip.txt - so I'm hoping this is
> more of a random find and you're not actually using it?
>
>
> Thanks
> Heiko
>
> [0] https://git.kernel.org/cgit/linux/kernel/git/mmind/linux-rockchip.git/commit/?id=023a8280b8355a0aebe094299afec8d8b7b264cd
>

[toc] | [prev] | [next] | [standalone]


#1469511

FromHeiko Stübner <heiko@sntech.de>
Date2016-08-24 17:00 +0200
Message-ID<s9HOO-3F4-29@gated-at.bofh.it>
In reply to#1469489
Hi Arvind,

Am Mittwoch, 24. August 2016, 19:52:45 schrieb arvind Yadav:
> yes, I am referring this code for clock control.

Please definitly do not use that old gate driver anymore!

Instead please look at the real clock drivers for specific Rockchip socs in the 
same directory.
Which Rockchip soc are you working on?


Heiko

> On Tuesday 23 August 2016 09:45 PM, Heiko Stübner wrote:
> > Hi Arvind,
> > 
> > Am Samstag, 13. August 2016, 20:56:18 schrieb Arvind Yadav:
> >> -check return of 'of_iomap'.if It's falied to remap then abort.
> >> 
> >> -Unmap a region obtained by remap. iounmap frees the mapping when failed
> >> to allocate the memory.
> >> 
> >> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> >> ---
> >> 
> >>   drivers/clk/rockchip/clk-rockchip.c | 7 ++++++-
> > 
> > I've applied the patch, after rewording both patch subject and message
> > [0].
> > 
> > That driver is deprecated for quite some time, see
> > Documenation/devicetree/bindings/clock/rockchip.txt - so I'm hoping this
> > is
> > more of a random find and you're not actually using it?
> > 
> > 
> > Thanks
> > Heiko
> > 
> > [0]
> > https://git.kernel.org/cgit/linux/kernel/git/mmind/linux-rockchip.git/com
> > mit/?id=023a8280b8355a0aebe094299afec8d8b7b264cd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web