OSDN Git Service

regmap: debugfs: Make sure we store the last entry in the offset cache
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 8 Jan 2013 18:47:52 +0000 (18:47 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 8 Jan 2013 20:52:51 +0000 (20:52 +0000)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-debugfs.c

index 720e142..46a213a 100644 (file)
@@ -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