Skip to content

Commit

Permalink
regmap: Fix rbtreee build when not using debugfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Nov 22, 2011
1 parent bad2ab4 commit cce585c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/base/regmap/regcache-rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down

0 comments on commit cce585c

Please sign in to comment.