public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.
@ 2016-08-13 15:26 Arvind Yadav
  2016-08-23 16:15 ` Heiko Stübner
  0 siblings, 1 reply; 4+ messages in thread
From: Arvind Yadav @ 2016-08-13 15:26 UTC (permalink / raw)
  To: mturquette, sboyd, heiko
  Cc: linux-clk, linux-arm-kernel, linux-rockchip, linux-kernel,
	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 ++++++-
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.
  2016-08-13 15:26 [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization Arvind Yadav
@ 2016-08-23 16:15 ` Heiko Stübner
  2016-08-24 14:22   ` arvind Yadav
  0 siblings, 1 reply; 4+ messages in thread
From: Heiko Stübner @ 2016-08-23 16:15 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: mturquette, sboyd, linux-clk, linux-arm-kernel, linux-rockchip,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.
  2016-08-23 16:15 ` Heiko Stübner
@ 2016-08-24 14:22   ` arvind Yadav
  2016-08-24 14:56     ` Heiko Stübner
  0 siblings, 1 reply; 4+ messages in thread
From: arvind Yadav @ 2016-08-24 14:22 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: mturquette, sboyd, linux-clk, linux-arm-kernel, linux-rockchip,
	linux-kernel

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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization.
  2016-08-24 14:22   ` arvind Yadav
@ 2016-08-24 14:56     ` Heiko Stübner
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Stübner @ 2016-08-24 14:56 UTC (permalink / raw)
  To: arvind Yadav
  Cc: mturquette, sboyd, linux-clk, linux-arm-kernel, linux-rockchip,
	linux-kernel

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 soc=
s in the=20
same directory.
Which Rockchip soc are you working on?


Heiko

> On Tuesday 23 August 2016 09:45 PM, Heiko St=FCbner wrote:
> > Hi Arvind,
> >=20
> > Am Samstag, 13. August 2016, 20:56:18 schrieb Arvind Yadav:
> >> -check return of 'of_iomap'.if It's falied to remap then abort.
> >>=20
> >> -Unmap a region obtained by remap. iounmap frees the mapping when =
failed
> >> to allocate the memory.
> >>=20
> >> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> >> ---
> >>=20
> >>   drivers/clk/rockchip/clk-rockchip.c | 7 ++++++-
> >=20
> > I've applied the patch, after rewording both patch subject and mess=
age
> > [0].
> >=20
> > 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?
> >=20
> >=20
> > Thanks
> > Heiko
> >=20
> > [0]
> > https://git.kernel.org/cgit/linux/kernel/git/mmind/linux-rockchip.g=
it/com
> > mit/?id=3D023a8280b8355a0aebe094299afec8d8b7b264cd

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-24 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-13 15:26 [v.1] clk:clk-rockchip:-of_iomap failed to remap then abort clock initialization Arvind Yadav
2016-08-23 16:15 ` Heiko Stübner
2016-08-24 14:22   ` arvind Yadav
2016-08-24 14:56     ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox