]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
regmap: Include the last register in debugfs output
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Sep 2011 15:13:07 +0000 (08:13 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Sep 2011 17:58:31 +0000 (10:58 -0700)
Off by one in the array iteration.

Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-debugfs.c

index 7a8d67537d3fb8a736612cca82933714470a6717..6f397476e27c010fd938dfd05b84eb68fcef7c77 100644 (file)
@@ -57,7 +57,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
        val_len = 2 * map->format.val_bytes;
        tot_len = reg_len + val_len + 3;      /* : \n */
 
-       for (i = 0; i < map->max_register; i++) {
+       for (i = 0; i < map->max_register + 1; i++) {
                if (!regmap_readable(map, i))
                        continue;
 
@@ -132,7 +132,7 @@ static ssize_t regmap_access_read_file(struct file *file,
        reg_len = regmap_calc_reg_len(map->max_register, buf, count);
        tot_len = reg_len + 10; /* ': R W V P\n' */
 
-       for (i = 0; i < map->max_register; i++) {
+       for (i = 0; i < map->max_register + 1; i++) {
                /* Ignore registers which are neither readable nor writable */
                if (!regmap_readable(map, i) && !regmap_writeable(map, i))
                        continue;