linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: reset: at91-sama5d2_shdwc: Use devm_platform_get_and_ioremap_resource()
@ 2023-02-15  6:50 ye.xingchen
  2023-02-16 10:01 ` Claudiu.Beznea
  0 siblings, 1 reply; 2+ messages in thread
From: ye.xingchen @ 2023-02-15  6:50 UTC (permalink / raw)
  To: sre
  Cc: alexandre.belloni, linux-pm, linux-kernel, claudiu.beznea,
	linux-arm-kernel

From: Ye Xingchen <ye.xingchen@zte.com.cn>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
---
 drivers/power/reset/at91-sama5d2_shdwc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
index d8ecffe72f16..3142ac53782b 100644
--- a/drivers/power/reset/at91-sama5d2_shdwc.c
+++ b/drivers/power/reset/at91-sama5d2_shdwc.c
@@ -331,7 +331,6 @@ static const struct of_device_id at91_pmc_ids[] = {

 static int __init at91_shdwc_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	const struct of_device_id *match;
 	struct device_node *np;
 	u32 ddr_type;
@@ -349,8 +348,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)

 	platform_set_drvdata(pdev, at91_shdwc);

-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	at91_shdwc->shdwc_base = devm_ioremap_resource(&pdev->dev, res);
+	at91_shdwc->shdwc_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
 	if (IS_ERR(at91_shdwc->shdwc_base))
 		return PTR_ERR(at91_shdwc->shdwc_base);

-- 
2.25.1

_______________________________________________
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] 2+ messages in thread

* Re: [PATCH] power: reset: at91-sama5d2_shdwc: Use devm_platform_get_and_ioremap_resource()
  2023-02-15  6:50 [PATCH] power: reset: at91-sama5d2_shdwc: Use devm_platform_get_and_ioremap_resource() ye.xingchen
@ 2023-02-16 10:01 ` Claudiu.Beznea
  0 siblings, 0 replies; 2+ messages in thread
From: Claudiu.Beznea @ 2023-02-16 10:01 UTC (permalink / raw)
  To: ye.xingchen, sre
  Cc: linux-kernel, alexandre.belloni, linux-arm-kernel, linux-pm

On 15.02.2023 08:50, ye.xingchen@zte.com.cn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> From: Ye Xingchen <ye.xingchen@zte.com.cn>
> 
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/power/reset/at91-sama5d2_shdwc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c
> index d8ecffe72f16..3142ac53782b 100644
> --- a/drivers/power/reset/at91-sama5d2_shdwc.c
> +++ b/drivers/power/reset/at91-sama5d2_shdwc.c
> @@ -331,7 +331,6 @@ static const struct of_device_id at91_pmc_ids[] = {
> 
>  static int __init at91_shdwc_probe(struct platform_device *pdev)
>  {
> -       struct resource *res;
>         const struct of_device_id *match;
>         struct device_node *np;
>         u32 ddr_type;
> @@ -349,8 +348,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
> 
>         platform_set_drvdata(pdev, at91_shdwc);
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       at91_shdwc->shdwc_base = devm_ioremap_resource(&pdev->dev, res);
> +       at91_shdwc->shdwc_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
>         if (IS_ERR(at91_shdwc->shdwc_base))
>                 return PTR_ERR(at91_shdwc->shdwc_base);
> 
> --
> 2.25.1

_______________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2023-02-16 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15  6:50 [PATCH] power: reset: at91-sama5d2_shdwc: Use devm_platform_get_and_ioremap_resource() ye.xingchen
2023-02-16 10:01 ` Claudiu.Beznea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).