diff mbox series

[v2,1/2] pinctrl: ocelot: Fix the pincfg resource.

Message ID 20220304144432.3397621-2-horatiu.vultur@microchip.com
State New
Headers show
Series pinctrl: ocelot: Add fixes for ocelot driver | expand

Commit Message

Horatiu Vultur March 4, 2022, 2:44 p.m. UTC
The pincfg resources are in the second memory resource. But the driver
still tries to access the first memory resource to get the pincfg. This
is wrong therefore fix to access the second memory resource.

Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
Fixes: ad96111e658a95 ("pinctrl: ocelot: combine get resource and ioremap into single call")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/pinctrl/pinctrl-ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Walle March 7, 2022, 12:45 p.m. UTC | #1
> The pincfg resources are in the second memory resource. But the driver
> still tries to access the first memory resource to get the pincfg. This
> is wrong therefore fix to access the second memory resource.
> 
> Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
> Fixes: ad96111e658a95 ("pinctrl: ocelot: combine get resource and ioremap into single call")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>

There is already this patch pending, which does exactly
the same:
https://lore.kernel.org/linux-gpio/20220216082020.981797-1-michael@walle.cc/

FWIW, there is also this one:
https://lore.kernel.org/linux-gpio/20220216122727.1005041-1-michael@walle.cc/

-michael
Horatiu Vultur March 8, 2022, 8:30 a.m. UTC | #2
The 03/07/2022 13:45, Michael Walle wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> > The pincfg resources are in the second memory resource. But the driver
> > still tries to access the first memory resource to get the pincfg. This
> > is wrong therefore fix to access the second memory resource.
> >
> > Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
> > Fixes: ad96111e658a95 ("pinctrl: ocelot: combine get resource and ioremap into single call")
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> There is already this patch pending, which does exactly
> the same:
> https://lore.kernel.org/linux-gpio/20220216082020.981797-1-michael@walle.cc/

Sorry, I have missed your patch.
Should I resend this series where I will drop this patch? What is the
correct approach?

> 
> FWIW, there is also this one:
> https://lore.kernel.org/linux-gpio/20220216122727.1005041-1-michael@walle.cc/
> 
> -michael
Michael Walle March 8, 2022, 8:31 a.m. UTC | #3
Am 2022-03-08 09:30, schrieb Horatiu Vultur:
> The 03/07/2022 13:45, Michael Walle wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know 
>> the content is safe
>> 
>> > The pincfg resources are in the second memory resource. But the driver
>> > still tries to access the first memory resource to get the pincfg. This
>> > is wrong therefore fix to access the second memory resource.
>> >
>> > Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
>> > Fixes: ad96111e658a95 ("pinctrl: ocelot: combine get resource and ioremap into single call")
>> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
>> 
>> There is already this patch pending, which does exactly
>> the same:
>> https://lore.kernel.org/linux-gpio/20220216082020.981797-1-michael@walle.cc/
> 
> Sorry, I have missed your patch.
> Should I resend this series where I will drop this patch? What is the
> correct approach?

Actually, I don't know. Maybe you don't need to do anything, Linus?

-michael
Linus Walleij March 15, 2022, 12:51 a.m. UTC | #4
On Tue, Mar 8, 2022 at 9:32 AM Michael Walle <michael@walle.cc> wrote:
> Am 2022-03-08 09:30, schrieb Horatiu Vultur:
> > The 03/07/2022 13:45, Michael Walle wrote:
> >> EXTERNAL EMAIL: Do not click links or open attachments unless you know
> >> the content is safe
> >>
> >> > The pincfg resources are in the second memory resource. But the driver
> >> > still tries to access the first memory resource to get the pincfg. This
> >> > is wrong therefore fix to access the second memory resource.
> >> >
> >> > Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
> >> > Fixes: ad96111e658a95 ("pinctrl: ocelot: combine get resource and ioremap into single call")
> >> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> >>
> >> There is already this patch pending, which does exactly
> >> the same:
> >> https://lore.kernel.org/linux-gpio/20220216082020.981797-1-michael@walle.cc/
> >
> > Sorry, I have missed your patch.
> > Should I resend this series where I will drop this patch? What is the
> > correct approach?
>
> Actually, I don't know. Maybe you don't need to do anything, Linus?

I'll just apply 2/2 if applicable.

Yours,
Linus Walleij
diff mbox series

Patch

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;