lkml.org 
[lkml]   [2013]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] regmap: debugfs: Fix last entry store in the offset cache
Date
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@pengutronix.de>
---
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


\
 
 \ /
  Last update: 2013-01-16 15:01    [W:0.026 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site