regmap: Fix rbtreee build when not using debugfs
Mark Brown [Tue, 22 Nov 2011 11:33:31 +0000 (11:33 +0000)]
The debugfs functions don't stub themselves out quite so well as might
be desirable so provide functions which do do this stubbing.

Reported-by: Uwe Kleine-K├Ânig <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit cce585ce1ebd5307c9709e24758d5eb8a1e087a7)

Change-Id: I98580d938816e547c0b3c006be93facf38a29965
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/87569

drivers/base/regmap/regcache-rbtree.c

index 7767cbb..32620c4 100644 (file)
@@ -170,6 +170,15 @@ static const struct file_operations rbtree_fops = {
        .llseek         = seq_lseek,
        .release        = single_release,
 };
+
+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)
@@ -194,7 +203,7 @@ static int regcache_rbtree_init(struct regmap *map)
                        goto err;
        }
 
-       debugfs_create_file("rbtree", 0400, map->debugfs, map, &rbtree_fops);
+       rbtree_debugfs_init(map);
 
        return 0;