[PATCH] pinctrl: ocelot: fix duplicate debugfs entry

Michael Walle posted 1 patch 4 years, 4 months ago
drivers/pinctrl/pinctrl-ocelot.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] pinctrl: ocelot: fix duplicate debugfs entry
Posted by Michael Walle 4 years, 4 months ago
This driver can have up to two regmaps. If the second one is registered
its debugfs entry will have the same name as the first one and the
following error will be printed:

[    2.242568] debugfs: Directory 'e2004064.pinctrl' with parent 'regmap' already present!

Give the second regmap a name to avoid this.

Fixes: 076d9e71bcf8 ("pinctrl: ocelot: convert pinctrl to regmap")
Signed-off-by: Michael Walle <michael@walle.cc>
---
 drivers/pinctrl/pinctrl-ocelot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index a859fbcb09af..35b213de1af8 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1890,6 +1890,7 @@ static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev)
 		.val_bits = 32,
 		.reg_stride = 4,
 		.max_register = 32,
+		.name = "pincfg",
 	};
 
 	base = devm_platform_ioremap_resource(pdev, 1);
-- 
2.30.2

Re: [PATCH] pinctrl: ocelot: fix duplicate debugfs entry
Posted by Colin Foster 4 years, 4 months ago
On Wed, Feb 16, 2022 at 01:27:27PM +0100, Michael Walle wrote:
> This driver can have up to two regmaps. If the second one is registered
> its debugfs entry will have the same name as the first one and the
> following error will be printed:
> 
> [    2.242568] debugfs: Directory 'e2004064.pinctrl' with parent 'regmap' already present!
> 
> Give the second regmap a name to avoid this.
> 
> Fixes: 076d9e71bcf8 ("pinctrl: ocelot: convert pinctrl to regmap")
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  drivers/pinctrl/pinctrl-ocelot.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
> index a859fbcb09af..35b213de1af8 100644
> --- a/drivers/pinctrl/pinctrl-ocelot.c
> +++ b/drivers/pinctrl/pinctrl-ocelot.c
> @@ -1890,6 +1890,7 @@ static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev)
>  		.val_bits = 32,
>  		.reg_stride = 4,
>  		.max_register = 32,
> +		.name = "pincfg",
>  	};
>  
>  	base = devm_platform_ioremap_resource(pdev, 1);
> -- 
> 2.30.2
> 

Reviewed-by: Colin Foster <colin.foster@in-advantage.com>


Re: [PATCH] pinctrl: ocelot: fix duplicate debugfs entry
Posted by Linus Walleij 4 years, 3 months ago
On Wed, Feb 16, 2022 at 1:27 PM Michael Walle <michael@walle.cc> wrote:

> This driver can have up to two regmaps. If the second one is registered
> its debugfs entry will have the same name as the first one and the
> following error will be printed:
>
> [    2.242568] debugfs: Directory 'e2004064.pinctrl' with parent 'regmap' already present!
>
> Give the second regmap a name to avoid this.
>
> Fixes: 076d9e71bcf8 ("pinctrl: ocelot: convert pinctrl to regmap")
> Signed-off-by: Michael Walle <michael@walle.cc>

Patch applied!

Yours,
Linus Walleij