Re: [PATCH v4 6/7] iio: adc: hx711: pass iio_chan_spec to hx711_reset_read()

Andy Shevchenko
2026-04-27T14:16:34Z

On Mon, Apr 27, 2026 at 03:39:37PM +0530, Piyush Patle wrote:
> Change hx711_reset_read() to accept a const struct iio_chan_spec *
> instead of a plain integer channel index. This lets the HX710B support
> patch pass the full channel descriptor (including chan->address for the

s/patch/change in the future/

> trailing pulse count) without adding a wrapper or a separate code path
> for each call site.
>
> Update the two callers: hx711_read_raw() already has the iio_chan_spec *
> from its own parameter, and hx711_trigger() passes &indio_dev->channels[i].
>
> No functional change.

...

> iio_for_each_active_channel(indio_dev, i) {
> hx711_data->buffer.channel[j] = hx711_reset_read(hx711_data,
> - indio_dev->channels[i].channel);
> + &indio_dev->channels[i]);

Re-indent this to be

hx711_data->buffer.channel[j] =
hx711_reset_read(hx711_data, &indio_dev->channels[i]);

> j++;
> }

--
With Best Regards,
Andy Shevchenko