]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: hx711: move scale computation to per-device storage
authorPiyush Patle <piyushpatle228@gmail.com>
Mon, 11 May 2026 17:43:30 +0000 (23:13 +0530)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:39 +0000 (10:59 +0100)
commit0ce8e3b445a3fec83a023f11512f63ff6da0d460
treeaa5d1dceccfbc39bd6ed2573b28bded484ef0aeb
parentd20605e18129079876485d652992c7ab48aaecde
iio: adc: hx711: move scale computation to per-device storage

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.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/hx711.c