Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d49b598 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

regmap: cache: Make sure to sync the last register in a block



regcache_sync_block_raw_flush() expects the address of the register after last
register that needs to be synced as its parameter. But the last call to
regcache_sync_block_raw_flush() in regcache_sync_block_raw() passes the address
of the last register in the block. This effectively always skips over the last
register in a block, even if it needs to be synced. In order to fix it increase
the address by one register.

The issue was introduced in commit 75a5f89f ("regmap: cache: Write consecutive
registers in a single block write").

Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent c095ba72
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -719,7 +719,8 @@ static int regcache_sync_block_raw(struct regmap *map, void *block,
		}
		}
	}
	}


	return regcache_sync_block_raw_flush(map, &data, base, regtmp);
	return regcache_sync_block_raw_flush(map, &data, base, regtmp +
			map->reg_stride);
}
}


int regcache_sync_block(struct regmap *map, void *block,
int regcache_sync_block(struct regmap *map, void *block,