Re: [PATCH v4 6/7] iio: adc: hx711: pass iio_chan_spec to hx711_reset_read()
From: Andy Shevchenko
Date: Mon Apr 27 2026 - 10:21:03 EST
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