From: Mark Brown Date: Tue, 8 Jan 2013 18:47:52 +0000 (+0000) Subject: regmap: debugfs: Make sure we store the last entry in the offset cache X-Git-Tag: firefly_0821_release~3680^2~1262^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e8d6539c8a94b88fc7ca5d6bdd9eeb0e64b434e4;p=firefly-linux-kernel-4.4.55.git regmap: debugfs: Make sure we store the last entry in the offset cache Signed-off-by: Mark Brown --- 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