Commit b7c05622 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull regmap fix from Mark Brown:
 "The I2C bus was not taking account of the register and any padding
  bytes when handling maximum write sizes supported by an I2C adaptor,
  this patch from Jim Wylder fixes that"

* tag 'regmap-fix-v6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap-i2c: Subtract reg size from max_write
parents 0f9a7517 611b7eb1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -350,7 +350,8 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,

		if (quirks->max_write_len &&
		    (bus->max_raw_write == 0 || bus->max_raw_write > quirks->max_write_len))
			max_write = quirks->max_write_len;
			max_write = quirks->max_write_len -
				(config->reg_bits + config->pad_bits) / BITS_PER_BYTE;

		if (max_read || max_write) {
			ret_bus = kmemdup(bus, sizeof(*bus), GFP_KERNEL);