2022-02-16 08:29:15

by Michael Walle

[permalink] [raw]
Subject: [PATCH] pinctrl: ocelot: fix confops resource index

Prior to commit ad96111e658a ("pinctrl: ocelot: combine get resource and
ioremap into single call") the resource index was 1, now it is 0. But 0
is the base region for the pinctrl block. Fix it.
I noticed this because there was an error that the memory region was
ioremapped twice.

Fixes: ad96111e658a ("pinctrl: ocelot: combine get resource and ioremap into single call")
Signed-off-by: Michael Walle <[email protected]>
---
drivers/pinctrl/pinctrl-ocelot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index 685c79e08d40..a859fbcb09af 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1892,7 +1892,7 @@ static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev)
.max_register = 32,
};

- base = devm_platform_ioremap_resource(pdev, 0);
+ base = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(base)) {
dev_dbg(&pdev->dev, "Failed to ioremap config registers (no extended pinconf)\n");
return NULL;
--
2.30.2


2022-02-16 16:42:47

by Colin Foster

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: ocelot: fix confops resource index

Hi Michael,

On Wed, Feb 16, 2022 at 09:20:20AM +0100, Michael Walle wrote:
> Prior to commit ad96111e658a ("pinctrl: ocelot: combine get resource and
> ioremap into single call") the resource index was 1, now it is 0. But 0
> is the base region for the pinctrl block. Fix it.
> I noticed this because there was an error that the memory region was
> ioremapped twice.

My apologies... I missed this and didn't have access to hardware to
test. Thanks for the fix.

Reviewed-by: Colin Foster <[email protected]>


>
> Fixes: ad96111e658a ("pinctrl: ocelot: combine get resource and ioremap into single call")
> Signed-off-by: Michael Walle <[email protected]>
> ---
> drivers/pinctrl/pinctrl-ocelot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
> index 685c79e08d40..a859fbcb09af 100644
> --- a/drivers/pinctrl/pinctrl-ocelot.c
> +++ b/drivers/pinctrl/pinctrl-ocelot.c
> @@ -1892,7 +1892,7 @@ static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev)
> .max_register = 32,
> };
>
> - base = devm_platform_ioremap_resource(pdev, 0);
> + base = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(base)) {
> dev_dbg(&pdev->dev, "Failed to ioremap config registers (no extended pinconf)\n");
> return NULL;
> --
> 2.30.2
>

2022-03-16 04:14:39

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: ocelot: fix confops resource index

On Wed, Feb 16, 2022 at 9:20 AM Michael Walle <[email protected]> wrote:

> Prior to commit ad96111e658a ("pinctrl: ocelot: combine get resource and
> ioremap into single call") the resource index was 1, now it is 0. But 0
> is the base region for the pinctrl block. Fix it.
> I noticed this because there was an error that the memory region was
> ioremapped twice.
>
> Fixes: ad96111e658a ("pinctrl: ocelot: combine get resource and ioremap into single call")
> Signed-off-by: Michael Walle <[email protected]>

Patch applied!

Yours,
Linus Walleij