diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-05 19:13:07 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-05 21:58:31 +0400 |
commit | d813ae9a105219255c07d382059de831186c10d0 (patch) | |
tree | 51144b79a2ee1f3682ccc9a3976b7ad42a3634f3 /drivers/base/regmap/regmap-debugfs.c | |
parent | 5b457e3910251ef28712ba5d14adac8194bd5b2c (diff) | |
download | linux-d813ae9a105219255c07d382059de831186c10d0.tar.xz |
regmap: Include the last register in debugfs output
Off by one in the array iteration.
Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regmap-debugfs.c')
-rw-r--r-- | drivers/base/regmap/regmap-debugfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index 7a8d67537d3f..6f397476e27c 100644 --- a/drivers/base/regmap/regmap-debugfs.c +++ b/drivers/base/regmap/regmap-debugfs.c @@ -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; |