Re: regmap: Failed to create debugfs directory
From: Fabio Estevam
Date: Fri Mar 02 2018 - 07:35:34 EST
Hi Mark,
On Thu, Mar 1, 2018 at 9:27 PM, Fabio Estevam <festevam@xxxxxxxxx> wrote:
> Hi Mark,
>
> On Thu, Mar 1, 2018 at 3:24 PM, Mark Brown <broonie@xxxxxxxxxx> wrote:
>
>> Is this triggered by 9b947a13e7f6017f18 (regmap: use debugfs even when
>> no device)?
>
> Yes, exactly. If I revert this commit the warnings are gone.
>
> Should I send a revert or is there another way to solve it?
Does the change below look good?
diff --git a/drivers/base/regmap/regmap-debugfs.c
b/drivers/base/regmap/regmap-debugfs.c
index 7eb512b..018d3a2 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -575,7 +575,8 @@ 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;
}