summaryrefslogtreecommitdiff
path: root/drivers/base/regmap/regcache-rbtree.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-08-24 15:32:27 +0200
committerMark Brown <broonie@linaro.org>2014-08-26 09:11:56 +0100
commit5e0cbe78762b5f02986bf9e59a188dad2f6e0be1 (patch)
treed6ee5f6447e1705588bdae6c0798b27787a2293b /drivers/base/regmap/regcache-rbtree.c
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
downloadlwn-5e0cbe78762b5f02986bf9e59a188dad2f6e0be1.tar.gz
lwn-5e0cbe78762b5f02986bf9e59a188dad2f6e0be1.zip
regmap: Fix regcache debugfs initialization
Commit 6cfec04bcc05 ("regmap: Separate regmap dev initialization") moved the regmap debugfs initialization after regcache initialization. This means that the regmap debugfs directory is not created yet when the cache initialization runs and so any debugfs files registered by the regcache are created in the debugfs root directory rather than the debugfs directory of the regmap instance. Fix this by adding a separate callback for the regcache debugfs initialization which will be called after the parent debugfs entry has been created. Fixes: 6cfec04bcc05 (regmap: Separate regmap dev initialization) Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/base/regmap/regcache-rbtree.c')
-rw-r--r--drivers/base/regmap/regcache-rbtree.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index 6a7e4fa12854..f3e8fe0cc650 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -194,10 +194,6 @@ static void rbtree_debugfs_init(struct regmap *map)
{
debugfs_create_file("rbtree", 0400, map->debugfs, map, &rbtree_fops);
}
-#else
-static void rbtree_debugfs_init(struct regmap *map)
-{
-}
#endif
static int regcache_rbtree_init(struct regmap *map)
@@ -222,8 +218,6 @@ static int regcache_rbtree_init(struct regmap *map)
goto err;
}
- rbtree_debugfs_init(map);
-
return 0;
err:
@@ -532,6 +526,9 @@ struct regcache_ops regcache_rbtree_ops = {
.name = "rbtree",
.init = regcache_rbtree_init,
.exit = regcache_rbtree_exit,
+#ifdef CONFIG_DEBUG_FS
+ .debugfs_init = rbtree_debugfs_init,
+#endif
.read = regcache_rbtree_read,
.write = regcache_rbtree_write,
.sync = regcache_rbtree_sync,