summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-08 19:47:52 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-08 21:52:51 +0100
commite8d6539c8a94b88fc7ca5d6bdd9eeb0e64b434e4 (patch)
tree8ed281160ac777c4f42e2f93e291329ab6c43d8c /drivers
parentregmap: debugfs: Ensure a correct return value for empty caches (diff)
downloadlinux-e8d6539c8a94b88fc7ca5d6bdd9eeb0e64b434e4.tar.xz
linux-e8d6539c8a94b88fc7ca5d6bdd9eeb0e64b434e4.zip
regmap: debugfs: Make sure we store the last entry in the offset cache
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/regmap/regmap-debugfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 720e14248167..46a213a596e2 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -116,6 +116,15 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
}
}
+ /* Close the last entry off if we didn't scan beyond it */
+ if (c) {
+ c->max = p - 1;
+ list_add_tail(&c->list,
+ &map->debugfs_off_cache);
+ } else {
+ return base;
+ }
+
/*
* This should never happen; we return above if we fail to
* allocate and we should never be in this code if there are