Messages in this thread Patch in this message | | | From | Fabio Estevam <> | Date | Thu, 6 Jan 2022 23:22:32 -0300 | Subject | Re: [PATCH v2] regmap: debugfs: Free debugfs_name buffer after usage |
| |
Hi Mark,
On Thu, Jan 6, 2022 at 6:13 PM Fabio Estevam <festevam@gmail.com> wrote: > > Hi Mark, > > On Thu, Jan 6, 2022 at 5:05 PM Mark Brown <broonie@kernel.org> wrote: > > > > Where exactly would you like me to call regmap_debugfs_exit()? > > > > Before we try to reinitialise debugfs for the new name seems like the > > obvious place. > > I am afraid I am not enough familiar with regmap to fix this problem. > > If you could please submit a patch, I will be glad to test it.
I tried this change:
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index ad684d37c2da..fa8821ecc06a 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -581,6 +581,8 @@ void regmap_debugfs_init(struct regmap *map) if (map->dev) devname = dev_name(map->dev);
+ regmap_debugfs_exit(map); + if (name) { if (!map->debugfs_name) { map->debugfs_name = kasprintf(GFP_KERNEL, "%s-%s", It does avoid the 'already present' error and I see that /sys/kernel/debug/regmap/20e0000.pinctrl-gpr is present, but /sys/kernel/debug/regmap/20e0000.pinctrl-gpr is not. Not sure if this is the desired behavior. Cheers
| |