aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>2013-02-07 05:51:56 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-08 06:31:34 -0500
commitf3eb83994cb4c172ce5028b5ae7ea08462cc3f1d (patch)
tree7e246716667bd4a4ce6da0cafd60777db529e3cb
parenta3471469bcba61f8f18ca4c267b0cdd90a61e035 (diff)
regmap: debugfs: Fix reading in register field units
At the moment, if the length of the register field format is N bytes, we can only get anything meaningful back to userspace by providing a buffer that is N + 2 bytes large. Fix this so we that we only need to provide a buffer of N bytes. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/base/regmap/regmap-debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index faa93cc6802e..0e94fd3c95a3 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -185,7 +185,7 @@ static ssize_t regmap_read_debugfs(struct regmap *map, unsigned int from,
185 /* If we're in the region the user is trying to read */ 185 /* If we're in the region the user is trying to read */
186 if (p >= *ppos) { 186 if (p >= *ppos) {
187 /* ...but not beyond it */ 187 /* ...but not beyond it */
188 if (buf_pos + 1 + map->debugfs_tot_len >= count) 188 if (buf_pos + map->debugfs_tot_len > count)
189 break; 189 break;
190 190
191 /* Format the register */ 191 /* Format the register */