All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
@ 2023-04-13  9:01 ` Hao Ge
  0 siblings, 0 replies; 8+ messages in thread
From: Hao Ge @ 2023-04-13  9:01 UTC (permalink / raw)
  To: mturquette, sboyd, matthias.bgg
  Cc: gehao, linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek

Use devm_platform_ioremap_resource to take the place of of_iomap for
avoid that we don't called iounmap when return some error or remove
device.

Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
 drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
index a56c5845d07a..fe386bf8225d 100644
--- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
+++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
@@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
 	struct clk_hw *hw;
 	int r;
 
-	base = of_iomap(node, 0);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (!base)
 		return PTR_ERR(base);
 
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

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

* [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
@ 2023-04-13  9:01 ` Hao Ge
  0 siblings, 0 replies; 8+ messages in thread
From: Hao Ge @ 2023-04-13  9:01 UTC (permalink / raw)
  To: mturquette, sboyd, matthias.bgg
  Cc: gehao, linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek

Use devm_platform_ioremap_resource to take the place of of_iomap for
avoid that we don't called iounmap when return some error or remove
device.

Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
 drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
index a56c5845d07a..fe386bf8225d 100644
--- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
+++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
@@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
 	struct clk_hw *hw;
 	int r;
 
-	base = of_iomap(node, 0);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (!base)
 		return PTR_ERR(base);
 
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
  2023-04-13  9:01 ` Hao Ge
@ 2023-04-13 18:40   ` Stephen Boyd
  -1 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2023-04-13 18:40 UTC (permalink / raw)
  To: Hao Ge, matthias.bgg, mturquette
  Cc: gehao, linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek

Quoting Hao Ge (2023-04-13 02:01:28)
> diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> index a56c5845d07a..fe386bf8225d 100644
> --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> @@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
>         struct clk_hw *hw;
>         int r;
>  
> -       base = of_iomap(node, 0);
> +       base = devm_platform_ioremap_resource(pdev, 0);
>         if (!base)

This needs to be updated.

>                 return PTR_ERR(base);

And PTR_ERR(NULL) is 0, which is wrong.

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

* Re: [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
@ 2023-04-13 18:40   ` Stephen Boyd
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2023-04-13 18:40 UTC (permalink / raw)
  To: Hao Ge, matthias.bgg, mturquette
  Cc: gehao, linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek

Quoting Hao Ge (2023-04-13 02:01:28)
> diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> index a56c5845d07a..fe386bf8225d 100644
> --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
> @@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
>         struct clk_hw *hw;
>         int r;
>  
> -       base = of_iomap(node, 0);
> +       base = devm_platform_ioremap_resource(pdev, 0);
>         if (!base)

This needs to be updated.

>                 return PTR_ERR(base);

And PTR_ERR(NULL) is 0, which is wrong.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
  2023-04-13 18:40   ` Stephen Boyd
@ 2023-04-20  8:53     ` Hao Ge
  -1 siblings, 0 replies; 8+ messages in thread
From: Hao Ge @ 2023-04-20  8:53 UTC (permalink / raw)
  To: Stephen Boyd, matthias.bgg, mturquette
  Cc: linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek

On 4/14/23 02:40, Stephen Boyd wrote:
> Quoting Hao Ge (2023-04-13 02:01:28)
>> diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
>> index a56c5845d07a..fe386bf8225d 100644
>> --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
>> +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
>> @@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
>>          struct clk_hw *hw;
>>          int r;
>>   
>> -       base = of_iomap(node, 0);
>> +       base = devm_platform_ioremap_resource(pdev, 0);
>>          if (!base)
> 
> This needs to be updated.
> 
>>                  return PTR_ERR(base);
> 
> And PTR_ERR(NULL) is 0, which is wrong.
Thank you for pointing out this point and Sorry for the late reply.
I will update the v2 for it.

Best regards.
Hao

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

* Re: [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
@ 2023-04-20  8:53     ` Hao Ge
  0 siblings, 0 replies; 8+ messages in thread
From: Hao Ge @ 2023-04-20  8:53 UTC (permalink / raw)
  To: Stephen Boyd, matthias.bgg, mturquette
  Cc: linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek

On 4/14/23 02:40, Stephen Boyd wrote:
> Quoting Hao Ge (2023-04-13 02:01:28)
>> diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
>> index a56c5845d07a..fe386bf8225d 100644
>> --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
>> +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
>> @@ -90,7 +90,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
>>          struct clk_hw *hw;
>>          int r;
>>   
>> -       base = of_iomap(node, 0);
>> +       base = devm_platform_ioremap_resource(pdev, 0);
>>          if (!base)
> 
> This needs to be updated.
> 
>>                  return PTR_ERR(base);
> 
> And PTR_ERR(NULL) is 0, which is wrong.
Thank you for pointing out this point and Sorry for the late reply.
I will update the v2 for it.

Best regards.
Hao

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V2] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
  2023-04-20  8:53     ` Hao Ge
@ 2023-04-20  9:11       ` Hao Ge
  -1 siblings, 0 replies; 8+ messages in thread
From: Hao Ge @ 2023-04-20  9:11 UTC (permalink / raw)
  To: sboyd, mturquette, matthias.bgg
  Cc: gehao, linux-arm-kernel, linux-clk, linux-kernel, linux-mediatek,
	gehao618

Use devm_platform_ioremap_resource to take the place of of_iomap for
avoid that we don't called iounmap when return some error or remove
device.

Signed-off-by: Hao Ge <gehao@kylinos.cn>
Suggested-by: Stephen Boyd <sboyd@kernel.org>
---

v2: fix error handle condition for devm_platform_ioremap_resource
---
 drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
index a56c5845d07a..73c29d1dccc6 100644
--- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
+++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
@@ -90,8 +90,8 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
 	struct clk_hw *hw;
 	int r;
 
-	base = of_iomap(node, 0);
-	if (!base)
+	base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(base))
 		return PTR_ERR(base);
 
 	clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

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

* [PATCH V2] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource
@ 2023-04-20  9:11       ` Hao Ge
  0 siblings, 0 replies; 8+ messages in thread
From: Hao Ge @ 2023-04-20  9:11 UTC (permalink / raw)
  To: sboyd, mturquette, matthias.bgg
  Cc: gehao, linux-arm-kernel, linux-clk, linux-kernel, linux-mediatek,
	gehao618

Use devm_platform_ioremap_resource to take the place of of_iomap for
avoid that we don't called iounmap when return some error or remove
device.

Signed-off-by: Hao Ge <gehao@kylinos.cn>
Suggested-by: Stephen Boyd <sboyd@kernel.org>
---

v2: fix error handle condition for devm_platform_ioremap_resource
---
 drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
index a56c5845d07a..73c29d1dccc6 100644
--- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
+++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c
@@ -90,8 +90,8 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
 	struct clk_hw *hw;
 	int r;
 
-	base = of_iomap(node, 0);
-	if (!base)
+	base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(base))
 		return PTR_ERR(base);
 
 	clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-04-20  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13  9:01 [PATCH] mediatek/clk-mt8173-apmixedsys: convert to devm_platform_ioremap_resource Hao Ge
2023-04-13  9:01 ` Hao Ge
2023-04-13 18:40 ` Stephen Boyd
2023-04-13 18:40   ` Stephen Boyd
2023-04-20  8:53   ` Hao Ge
2023-04-20  8:53     ` Hao Ge
2023-04-20  9:11     ` [PATCH V2] " Hao Ge
2023-04-20  9:11       ` Hao Ge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.