Skip to content

Commit db05767

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
regmap: fix bulk writes on paged registers
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>
1 parent 2899872 commit db05767

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/base/regmap/regmap.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,8 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
16371637
map->format.reg_bytes +
16381638
map->format.pad_bytes,
16391639
val, val_len);
1640+
else
1641+
ret = -ENOTSUPP;
16401642

16411643
/* If that didn't work fall back on linearising by hand. */
16421644
if (ret == -ENOTSUPP) {

0 commit comments

Comments
 (0)