Re: [PATCH v2 2/5] iio: adc: mcp320x: remove device_index check for TX

From: Andy Shevchenko
Date: Wed Aug 31 2022 - 08:43:50 EST


On Wed, Aug 31, 2022 at 1:05 PM Vincent Whitchurch
<vincent.whitchurch@xxxxxxxx> wrote:
>
> Replace the device_index switch with a TX value computation based on the
> number of channels in the chip_info structure, so that the latter has
> all the information needed to handle the variants.

...

> return ((start_bit << 4) | (!differential << 3) |
> + (address << 2));

At the same time can be put on the above line and removed couple of ().

...

> return ((start_bit << 6) | (!differential << 5) |
> - (channel << 2));
> + (address << 2));

Ditto.

--
With Best Regards,
Andy Shevchenko