regmap: debugfs: Do not print warning when no device is associated
Subsystems (2)
PATCH 1/1 regmap: debugfs: Do not print warning when no device is associated
From: Fabio Estevam <[email protected]>
Commit 9b947a13e7f6 ("regmap: use debugfs even when no device") allows the usage of regmap debugfs even when there is no device associated, which causes several warnings like this:
(NULL device *): Failed to create debugfs directory
Do not print the warning in the case there is no associated device.
--- drivers/base/regmap/regmap-debugfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/base/regmap/regmap-debugfs.c +3 -1
@@ -575,7 +575,9 @@ void regmap_debugfs_init(struct regmap *map, const char *name) map->debugfs =debugfs_create_dir (name, regmap_debugfs_root);if (!map->debugfs) { -dev_warn (map->dev,"Failed to create debugfs directory\n" ); +if (map->dev) +dev_warn (map->dev, +"Failed to create debugfs directory\n" );return ; }
Signature · 1 line
2.7.4
Mark Brown
maintainerQuoted 10 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Commit
9b947a13e7f6("regmap: use debugfs even when no device") allows the usage of regmap debugfs even when there is no device associated, which causes several warnings like this:(NULL device *): Failed to create debugfs directory
Do not print the warning in the case there is no associated device.
drivers/base/regmap/regmap-debugfs.c void regmap_debugfs_init(struct regmap *map, const char *name) · line 580
Quoted 6 lines
drivers/base/regmap/regmap-debugfs.c +3
-1map->debugfs =debugfs_create_dir (name, regmap_debugfs_root);if (!map->debugfs) { -dev_warn (map->dev,"Failed to create debugfs directory\n" ); +if (map->dev) +dev_warn (map->dev, +"Failed to create debugfs directory\n" );
This then means that we will just randomly not create a debugfs for anything except the first device that tries to do so with no device which doesn't seem right. We should try harder to create a name here, for example we could try printing the pointer to the map. Or keep a counter and use dummy0 and so on.
Hi Mark,
Quoted 5 lines · Mark Brown
This then means that we will just randomly not create a debugfs for anything except the first device that tries to do so with no device which doesn't seem right. We should try harder to create a name here, for example we could try printing the pointer to the map. Or keep a counter and use dummy0 and so on.
Tried your second suggestion of creating dummy0, dummy1, dummy2, etc and it worked here.
Will send a v2 shortly.
Thanks