regmap: cache: Handle stride > 1 in sync_block_raw_flush
authorDylan Reid <dgreid@chromium.org>
Fri, 24 Jan 2014 23:40:39 +0000 (15:40 -0800)
committerMark Brown <broonie@linaro.org>
Mon, 27 Jan 2014 18:25:11 +0000 (18:25 +0000)
commit78ba73eecd2256790926859849801c0446766c0a
treebb8876ab01f0ab70ec7d754cf131fcc7a8384ced
parent86776fc174973e556be7d668763f509a81124f8b
regmap: cache: Handle stride > 1 in sync_block_raw_flush

regcache_sync_block_raw_flush takes the address of the base register
and the address of one past the last register to write to.  "count" is
the number of registers in the range, not the number of bytes, it
should be (end addr - start addr) / stride. Without accounting for
strides greater than one, registers past the end might be synced or
the writeable_reg callback at the beginning of _regmap_raw_write will
fail and nothing will be written.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regcache.c