diff mbox series

[1/6] power: reset: at91-poweroff: Convert to devm_platform_ioremap_resource()

Message ID 20230704130309.16444-1-frank.li@vivo.com
State Accepted
Commit 0b64a0e53cc7875c2410b26a20c1269d72cd1428
Headers show
Series [1/6] power: reset: at91-poweroff: Convert to devm_platform_ioremap_resource() | expand

Commit Message

李扬韬 July 4, 2023, 1:03 p.m. UTC
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/power/reset/at91-poweroff.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Sebastian Reichel July 19, 2023, 9:37 p.m. UTC | #1
Hi,

On Tue, Jul 04, 2023 at 09:03:03PM +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---

Thanks, whole series queued.

-- Sebastian

>  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..dd5399785b69 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_ioremap_resource(pdev, 0);
>  	if (IS_ERR(at91_shdwc.shdwc_base))
>  		return PTR_ERR(at91_shdwc.shdwc_base);
>  
> -- 
> 2.39.0
>
diff mbox series

Patch

diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c
index 9e74e131c675..dd5399785b69 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_ioremap_resource(pdev, 0);
 	if (IS_ERR(at91_shdwc.shdwc_base))
 		return PTR_ERR(at91_shdwc.shdwc_base);