diff mbox series

power: reset: at91-poweroff: Use devm_platform_get_and_ioremap_resource()

Message ID 202302151449285733136@zte.com.cn (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series power: reset: at91-poweroff: Use devm_platform_get_and_ioremap_resource() | expand

Commit Message

ye.xingchen@zte.com.cn Feb. 15, 2023, 6:49 a.m. UTC
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-poweroff.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Claudiu Beznea Feb. 16, 2023, 10:01 a.m. UTC | #1
On 15.02.2023 08:49, 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-poweroff.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c
> index 9e74e131c675..b7e17afe30e2 100644
> --- a/drivers/power/reset/at91-poweroff.c
> +++ b/drivers/power/reset/at91-poweroff.c
> @@ -151,13 +151,11 @@ static void at91_poweroff_dt_set_wakeup_mode(struct platform_device *pdev)
> 
>  static int __init at91_poweroff_probe(struct platform_device *pdev)
>  {
> -       struct resource *res;
>         struct device_node *np;
>         u32 ddr_type;
>         int ret;
> 
> -       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
diff mbox series

Patch

diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c
index 9e74e131c675..b7e17afe30e2 100644
--- a/drivers/power/reset/at91-poweroff.c
+++ b/drivers/power/reset/at91-poweroff.c
@@ -151,13 +151,11 @@  static void at91_poweroff_dt_set_wakeup_mode(struct platform_device *pdev)

 static int __init at91_poweroff_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct device_node *np;
 	u32 ddr_type;
 	int ret;

-	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);