Re: [BUG] _regmap_raw_write() - divide-by-zero

From: Mark Brown
Date: Fri Jun 16 2023 - 18:03:00 EST


On Fri, Jun 16, 2023 at 02:58:24PM -0700, Russ Weight wrote:

> > +     size_t max_data = map->max_raw_write - map->format.reg_bytes -
> > +                     map->format.pad_bytes;

> For the SPI-Avalon implementation, the values used to calculate max_data are:

> regmap->max_raw_write = 4
> regmap->format->reg_bytes = 4
> regmap->format->pad_bytes = 0
>
> So the above calculation for max_data is: max_data = (4 - 4 - 0) = 0

How does this bus work? The device can accept a maximum of 4 bytes of
data but the register is 4 bytes in length so there's no space to
transmit a value.

Attachment: signature.asc
Description: PGP signature