summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2019-06-12 12:03:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 09:14:06 +0200
commitb01bf44c363dac31128c8a4ac15a740dcb6513cf (patch)
tree3b9f68c1255c06ca26d62fde27faa56909beef33 /drivers
parent544cd592ca72785c4a9132536b715de8ad6242b3 (diff)
downloadlinux-stable-b01bf44c363dac31128c8a4ac15a740dcb6513cf.tar.gz
linux-stable-b01bf44c363dac31128c8a4ac15a740dcb6513cf.tar.bz2
linux-stable-b01bf44c363dac31128c8a4ac15a740dcb6513cf.zip
regmap: fix bulk writes on paged registers
[ Upstream commit db057679de3e9e6a03c1bcd5aee09b0d25fd9f5b ] On buses like SlimBus and SoundWire which does not support gather_writes yet in regmap, A bulk write on paged register would be silently ignored after programming page. This is because local variable 'ret' value in regmap_raw_write_impl() gets reset to 0 once page register is written successfully and the code below checks for 'ret' value to be -ENOTSUPP before linearising the write buffer to send to bus->write(). Fix this by resetting the 'ret' value to -ENOTSUPP in cases where gather_writes() is not supported or single register write is not possible. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/regmap/regmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 0360a90ad6b6..6c9f6988bc09 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1618,6 +1618,8 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
map->format.reg_bytes +
map->format.pad_bytes,
val, val_len);
+ else
+ ret = -ENOTSUPP;
/* If that didn't work fall back on linearising by hand. */
if (ret == -ENOTSUPP) {