regmap: debugfs: "registers" & "access" for single register maps
authorPawel Moll <pawel.moll@arm.com>
Thu, 30 Jan 2014 13:26:32 +0000 (13:26 +0000)
committerMark Brown <broonie@linaro.org>
Mon, 3 Feb 2014 12:16:24 +0000 (12:16 +0000)
When a map covers a single register, max_register is equal
to 0, so the "registers" & "access" files were not created.
Now they will be, as register 0 must be readable for such
map to make sense.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regmap-debugfs.c

index c5471cd6ebb7bc78f1e8e63e0d4330e37835e5ca..45d812c0ea7751868d3d14d7691da6f74493b54a 100644 (file)
@@ -511,7 +511,7 @@ void regmap_debugfs_init(struct regmap *map, const char *name)
        debugfs_create_file("range", 0400, map->debugfs,
                            map, &regmap_reg_ranges_fops);
 
-       if (map->max_register) {
+       if (map->max_register || regmap_readable(map, 0)) {
                debugfs_create_file("registers", 0400, map->debugfs,
                                    map, &regmap_map_fops);
                debugfs_create_file("access", 0400, map->debugfs,