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

From: Linus Walleij
Date: Tue Apr 02 2019 - 05:19:10 EST


On Tue, Apr 2, 2019 at 4:10 PM Baolin Wang <baolin.wang@xxxxxxxxxx> wrote:
> On Tue, 2 Apr 2019 at 17:04, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> >
> > On Tue, Mar 12, 2019 at 1:57 AM Enrico Weigelt, metux IT consult
> > <info@xxxxxxxxx> 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@xxxxxxxxx>
> >
> > 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@xxxxxxxxx>
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@xxxxxxxxx>
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxx>
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

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