Re: [PATCH v2] regmap-i2c: Subtract reg size from max_write

From: Mark Brown
Date: Mon Jun 03 2024 - 08:09:02 EST


On Sun, Jun 02, 2024 at 10:29:07AM +0300, Andy Shevchenko wrote:

> > (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;

> Interesting. regmap-spi does this slightly differently, i.e. reg/8 + pad/8.
> I'm wondering which one is more correct (potential off-by-one I suppose).

The above seems more correct if we have less than a full byte of padding.

Attachment: signature.asc
Description: PGP signature