Re: [PATCH v7 05/11] iio: adc: hx711: move scale computation to per-device storage

From: Piyush Patle

Date: Mon May 11 2026 - 09:55:38 EST


On Mon, May 11, 2026 at 4:49 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> On Mon, May 11, 2026 at 01:19:27AM +0530, Piyush Patle wrote:
> > The gain-to-scale table is global today, so probe-time scale updates for
> > one device overwrite the values used by any earlier device instance.
> >
> > Fix this by making the gain table const and storing the computed scale
> > values per device in hx711_data.
> >
> > No functional change for single-sensor configurations.
>
> ...
>
> > for (i = 0; i < HX711_GAIN_MAX; i++)
> > if (hx711_gain_to_scale[i].channel == channel)
> > len += sprintf(buf + len, "0.%09d ",
> > - hx711_gain_to_scale[i].scale);
> > + hx711_data->gain_scale[i]);
>
> Since you touch the only line of continuation, fix indentation at the same
> time. No need to resend for this only, hopefully Jonathan tweaks this.

Ack, will fix it if a v8 is needed.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>