Re: [PATCH v3 2/3] iio: adc: hx711: refactor to per-chip hx711_chip_info structure

From: Jonathan Cameron

Date: Fri Apr 24 2026 - 07:55:51 EST


On Wed, 22 Apr 2026 23:29:09 +0530
Piyush Patle <piyushpatle228@xxxxxxxxx> wrote:

> Introduce hx711_chip_info to hold per-variant static configuration:
> device name, IIO channel spec, channel count, and iio_info pointer.
> Store a chip_info pointer in hx711_data and populate indio_dev fields
> from it at probe instead of hardcoding them.
>
> Pass trailing pulse count directly to hx711_read() instead of
> computing it inside the function, and change hx711_reset_read() to
> take a const struct iio_chan_spec * instead of an integer channel
> index so callers can pass the full channel descriptor.
>
> Use device_get_match_data() to look up the chip_info from the
> of_device_id table. No functional change for existing HX711 users.
>
> Signed-off-by: Piyush Patle <piyushpatle228@xxxxxxxxx>
One trivial additional thing from me. The white space tweak at the
end is correct but not in a patch doing anything else.
Maybe that would be ok in the one Andy is suggesting that includes
the update to the text just above it (though mention it in the commit
message as a 'whilst here'). Or just check for other whitespace
cleanup and do a patch just for those.

> diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
> index 1db8b68a8f64..a444a2872257 100644
> --- a/drivers/iio/adc/hx711.c
> +++ b/drivers/iio/adc/hx711.c

> @@ -571,7 +602,6 @@ static struct platform_driver hx711_driver = {
> module_platform_driver(hx711_driver);
>
> MODULE_AUTHOR("Andreas Klinger <ak@xxxxxxxxxxxxx>");
> -MODULE_DESCRIPTION("HX711 bitbanging driver - ADC for weight cells");
> +MODULE_DESCRIPTION("HX711 and compatible bitbanging ADC driver");
> MODULE_LICENSE("GPL");
> MODULE_ALIAS("platform:hx711-gpio");
> -
Stray change. Check patches after you generate them for stuff like this.