Skip to contentSkip to conversation

pinctrl: ocelot: fix confops resource index

PATCH In review Michael Walle 3 participants 3 messages Feb 16, 2022 – Mar 15, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/pinctrl/pinctrl-ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-ocelot.c +1 -1
index 685c79e08d40..a859fbcb09af 100644
@@ -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;
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Michael,

Quoted 5 lines · Michael Walle

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.

Quoted 23 lines
Fixes ad96111e658a ("pinctrl: ocelot: combine get resource and ioremap into single call")
---
 drivers/pinctrl/pinctrl-ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-ocelot.c +1 -1
index 685c79e08d40..a859fbcb09af 100644
@@ -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;
Signature · 1 line
2.30.2
#2 lore raw
In reply to Michael Walle
Quoted 8 lines · Michael Walle

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")

Patch applied!

Yours,
Linus Walleij