[PATCH] regmap: debugfs: Fix last entry store in the offset cache

From: Philipp Zabel
Date: Wed Jan 16 2013 - 08:24:00 EST


Commit e8d6539c8a94b88fc7ca5d6bdd9eeb0e64b434e4
(regmap: debugfs: Make sure we store the last entry in the offset cache)
causes regmap_debugfs_get_dump_start to unconditionally return base if
the debugfs_off_cache is not empty when the function is called (because
c == NULL). This effectively causes all but the first read from
debugfs/regmap/*/registers to start from register position 0, which
in turn results in infinitely looping debugfs register map output.

Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
---
drivers/base/regmap/regmap-debugfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 46a213a..b3369e6 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -114,15 +114,15 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,

p += map->debugfs_tot_len;
}
- }

- /* 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;
+ /* 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;
+ }
}

/*
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/