[32/32] pwm: atmel: convert to devm_platform_ioremap_resource
diff mbox series

Message ID 20191229080610.7597-32-tiny.windzz@gmail.com
State New
Headers show
Series
  • [01/32] pwm: sun4i: convert to devm_platform_ioremap_resource
Related show

Commit Message

Frank Lee Dec. 29, 2019, 8:06 a.m. UTC
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/pwm/pwm-atmel.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Claudiu Beznea Jan. 6, 2020, 10:32 a.m. UTC | #1
On 29.12.2019 10:06, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

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

> ---
>  drivers/pwm/pwm-atmel.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
> index 9ba733467e26..86cc5ccaa46c 100644
> --- a/drivers/pwm/pwm-atmel.c
> +++ b/drivers/pwm/pwm-atmel.c
> @@ -340,7 +340,6 @@ MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
>  static int atmel_pwm_probe(struct platform_device *pdev)
>  {
>         struct atmel_pwm_chip *atmel_pwm;
> -       struct resource *res;
>         int ret;
> 
>         atmel_pwm = devm_kzalloc(&pdev->dev, sizeof(*atmel_pwm), GFP_KERNEL);
> @@ -351,8 +350,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)
>         atmel_pwm->data = of_device_get_match_data(&pdev->dev);
>         atmel_pwm->updated_pwms = 0;
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       atmel_pwm->base = devm_ioremap_resource(&pdev->dev, res);
> +       atmel_pwm->base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(atmel_pwm->base))
>                 return PTR_ERR(atmel_pwm->base);
> 
> --
> 2.17.1
> 
>
Uwe Kleine-König May 23, 2020, 5:25 p.m. UTC | #2
Hello,

On Sun, Dec 29, 2019 at 08:06:10AM +0000, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks,
Uwe

Patch
diff mbox series

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index 9ba733467e26..86cc5ccaa46c 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -340,7 +340,6 @@  MODULE_DEVICE_TABLE(of, atmel_pwm_dt_ids);
 static int atmel_pwm_probe(struct platform_device *pdev)
 {
 	struct atmel_pwm_chip *atmel_pwm;
-	struct resource *res;
 	int ret;
 
 	atmel_pwm = devm_kzalloc(&pdev->dev, sizeof(*atmel_pwm), GFP_KERNEL);
@@ -351,8 +350,7 @@  static int atmel_pwm_probe(struct platform_device *pdev)
 	atmel_pwm->data = of_device_get_match_data(&pdev->dev);
 	atmel_pwm->updated_pwms = 0;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	atmel_pwm->base = devm_ioremap_resource(&pdev->dev, res);
+	atmel_pwm->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(atmel_pwm->base))
 		return PTR_ERR(atmel_pwm->base);