]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
regmap: debugfs: Fix attempts to read nonexistant register blocks
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 2 Jan 2013 15:32:00 +0000 (15:32 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 8 Jan 2013 20:52:45 +0000 (20:52 +0000)
Return the start of the last block we tried to read rather than a position,
and also make sure we update the byte position while we're at it.  Without
this reads that go into nonexistant areas get confused.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-debugfs.c

index 07aad786f817e88300af9c4d6d685391f41b3471..43d51dc3d58b3627c266bb0cad548474ff930640 100644 (file)
@@ -108,7 +108,8 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
                        return c->base_reg;
                }
 
-               ret = c->max;
+               *pos = c->min;
+               ret = c->base_reg;
        }
 
        return ret;