diff mbox series

[27/42] drivers: gpio: rcar: use devm_platform_ioremap_resource()

Message ID 1552330521-4276-27-git-send-email-info@metux.net (mailing list archive)
State Not Applicable
Headers show
Series [01/42] drivers: gpio: 74xx-mmio: use devm_platform_ioremap_resource() | expand

Commit Message

Enrico Weigelt, metux IT consult March 11, 2019, 6:55 p.m. UTC
Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/gpio/gpio-rcar.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Geert Uytterhoeven March 12, 2019, 7:01 p.m. UTC | #1
CC linux-renesas-soc

On Mon, Mar 11, 2019 at 7:58 PM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:
> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/gpio/gpio-rcar.c
> +++ b/drivers/gpio/gpio-rcar.c
> @@ -430,7 +430,7 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins)
>  static int gpio_rcar_probe(struct platform_device *pdev)
>  {
>         struct gpio_rcar_priv *p;
> -       struct resource *io, *irq;
> +       struct resource *irq;
>         struct gpio_chip *gpio_chip;
>         struct irq_chip *irq_chip;
>         struct device *dev = &pdev->dev;
> @@ -461,8 +461,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
>                 goto err0;
>         }
>
> -       io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       p->base = devm_ioremap_resource(dev, io);
> +       p->base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(p->base)) {
>                 ret = PTR_ERR(p->base);
>                 goto err0;

Gr{oetje,eeting}s,

                        Geert
Linus Walleij April 3, 2019, 3:34 a.m. UTC | #2
On Tue, Mar 12, 2019 at 1:58 AM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Patch applied with Geert's review.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index df4419e..187984d 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -430,7 +430,7 @@  static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins)
 static int gpio_rcar_probe(struct platform_device *pdev)
 {
 	struct gpio_rcar_priv *p;
-	struct resource *io, *irq;
+	struct resource *irq;
 	struct gpio_chip *gpio_chip;
 	struct irq_chip *irq_chip;
 	struct device *dev = &pdev->dev;
@@ -461,8 +461,7 @@  static int gpio_rcar_probe(struct platform_device *pdev)
 		goto err0;
 	}
 
-	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	p->base = devm_ioremap_resource(dev, io);
+	p->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(p->base)) {
 		ret = PTR_ERR(p->base);
 		goto err0;