diff mbox series

[29/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()

Message ID 1552330521-4276-29-git-send-email-info@metux.net
State New
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-sprd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Baolin Wang March 12, 2019, 2:40 a.m. UTC | #1
Hi,
On Tue, 12 Mar 2019 at 02:57, 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>
> ---
>  drivers/gpio/gpio-sprd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
> index 55072d2..f5c8b3a 100644
> --- a/drivers/gpio/gpio-sprd.c
> +++ b/drivers/gpio/gpio-sprd.c
> @@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev)
>  {
>         struct gpio_irq_chip *irq;
>         struct sprd_gpio *sprd_gpio;
> -       struct resource *res;
>         int ret;
>
>         sprd_gpio = devm_kzalloc(&pdev->dev, sizeof(*sprd_gpio), GFP_KERNEL);
> @@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)
>                 return sprd_gpio->irq;
>         }
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       sprd_gpio->base = devm_ioremap_resource(&pdev->dev, res);
> +       sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(sprd_gpio->base))
>                 return PTR_ERR(sprd_gpio->base);
>

Thanks for your patch.

Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Linus Walleij April 2, 2019, 9:04 a.m. UTC | #2
On Tue, Mar 12, 2019 at 1:57 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 Baolin's ACK.

Yours,
Linus Walleij
Baolin Wang April 2, 2019, 9:10 a.m. UTC | #3
Hi Linus,

On Tue, 2 Apr 2019 at 17:04, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Mar 12, 2019 at 1:57 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 Baolin's ACK.

This patch had some problems which I've pointed out and I did not ack
this patch. Please do not apply it now until fixing the problem.
Linus Walleij April 2, 2019, 9:18 a.m. UTC | #4
On Tue, Apr 2, 2019 at 4:10 PM Baolin Wang <baolin.wang@linaro.org> wrote:
> On Tue, 2 Apr 2019 at 17:04, Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > On Tue, Mar 12, 2019 at 1:57 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 Baolin's ACK.
>
> This patch had some problems which I've pointed out and I did not ack
> this patch. Please do not apply it now until fixing the problem.

Sorry, it's the gmail threading that confuse the different patches.

The patch I actually applied is for gpio-sprd.c and looks like this:

commit 851f66daeab961328507dcce0980cd7e4ff5f9ae (HEAD -> devel)
Author: Enrico Weigelt, metux IT consult <info@metux.net>
Date:   Mon Mar 11 19:55:08 2019 +0100

    drivers: gpio: sprd: use devm_platform_ioremap_resource()

    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: Baolin Wang <baolin.wang@linaro.org>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index 55072d2b367f..f5c8b3a351d5 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev)
 {
        struct gpio_irq_chip *irq;
        struct sprd_gpio *sprd_gpio;
-       struct resource *res;
        int ret;

        sprd_gpio = devm_kzalloc(&pdev->dev, sizeof(*sprd_gpio), GFP_KERNEL);
@@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)
                return sprd_gpio->irq;
        }

-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       sprd_gpio->base = devm_ioremap_resource(&pdev->dev, res);
+       sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(sprd_gpio->base))
                return PTR_ERR(sprd_gpio->base);

Yours,
Linus Walleij
Baolin Wang April 2, 2019, 9:20 a.m. UTC | #5
On Tue, 2 Apr 2019 at 17:19, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Apr 2, 2019 at 4:10 PM Baolin Wang <baolin.wang@linaro.org> wrote:
> > On Tue, 2 Apr 2019 at 17:04, Linus Walleij <linus.walleij@linaro.org> wrote:
> > >
> > > On Tue, Mar 12, 2019 at 1:57 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 Baolin's ACK.
> >
> > This patch had some problems which I've pointed out and I did not ack
> > this patch. Please do not apply it now until fixing the problem.
>
> Sorry, it's the gmail threading that confuse the different patches.
>
> The patch I actually applied is for gpio-sprd.c and looks like this:

Yes, this one is correct.  Thanks :)

>
> commit 851f66daeab961328507dcce0980cd7e4ff5f9ae (HEAD -> devel)
> Author: Enrico Weigelt, metux IT consult <info@metux.net>
> Date:   Mon Mar 11 19:55:08 2019 +0100
>
>     drivers: gpio: sprd: use devm_platform_ioremap_resource()
>
>     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: Baolin Wang <baolin.wang@linaro.org>
>     Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
> index 55072d2b367f..f5c8b3a351d5 100644
> --- a/drivers/gpio/gpio-sprd.c
> +++ b/drivers/gpio/gpio-sprd.c
> @@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev)
>  {
>         struct gpio_irq_chip *irq;
>         struct sprd_gpio *sprd_gpio;
> -       struct resource *res;
>         int ret;
>
>         sprd_gpio = devm_kzalloc(&pdev->dev, sizeof(*sprd_gpio), GFP_KERNEL);
> @@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)
>                 return sprd_gpio->irq;
>         }
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       sprd_gpio->base = devm_ioremap_resource(&pdev->dev, res);
> +       sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(sprd_gpio->base))
>                 return PTR_ERR(sprd_gpio->base);
>
> Yours,
> Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index 55072d2..f5c8b3a 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -219,7 +219,6 @@  static int sprd_gpio_probe(struct platform_device *pdev)
 {
 	struct gpio_irq_chip *irq;
 	struct sprd_gpio *sprd_gpio;
-	struct resource *res;
 	int ret;
 
 	sprd_gpio = devm_kzalloc(&pdev->dev, sizeof(*sprd_gpio), GFP_KERNEL);
@@ -232,8 +231,7 @@  static int sprd_gpio_probe(struct platform_device *pdev)
 		return sprd_gpio->irq;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	sprd_gpio->base = devm_ioremap_resource(&pdev->dev, res);
+	sprd_gpio->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sprd_gpio->base))
 		return PTR_ERR(sprd_gpio->base);