regmap: pass buffer size to regmap_raw_read() in regcache_hw_init()
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Wed, 13 Jan 2016 21:41:12 +0000 (22:41 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 15 Jan 2016 18:14:14 +0000 (18:14 +0000)
commitd51fe1f393a6b99e9133a3360036af2c21983ec2
tree574be4f6805505a1970d16768a961dc4fce4f18d
parent8005c49d9aea74d382f474ce11afbbc7d7130bec
regmap: pass buffer size to regmap_raw_read() in regcache_hw_init()

regcache_hw_init() uses regmap_raw_read() to initialize cache
when reg_defaults_raw isn't provided.

The last parameter to regmap_raw_read() is buffer size in bytes,
however regcache_hw_init() called it with number of registers
to read instead, which cause problem if they aren't one byte
wide in cache.

This wasn't triggered by any of current in-tree drivers
since they either have one-byte registers or provide
reg_defaults_raw explicitly.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regcache.c