Commit 83ded7cf authored by Zhang Lixu's avatar Zhang Lixu Committed by Jonathan Cameron
Browse files

iio: hid-sensor-prox: Restore lost scale assignments

The variables `scale_pre_decml`, `scale_post_decml`, and `scale_precision`
were assigned in commit d68c592e ("iio: hid-sensor-prox: Fix scale not
correct issue"), but due to a merge conflict in
commit 9c15db92 ("Merge tag 'iio-for-5.13a' of
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next"),
these assignments were lost.

Add back lost assignments and replace `st->prox_attr` with
`st->prox_attr[0]` because commit 596ef5cf ("iio: hid-sensor-prox: Add
support for more channels") changed `prox_attr` to an array.

Cc: stable@vger.kernel.org # 5.13+
Fixes: 9c15db92 ("Merge tag 'iio-for-5.13a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio

 into staging-next")
Signed-off-by: default avatarZhang Lixu <lixu.zhang@intel.com>
Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20250331055022.1149736-2-lixu.zhang@intel.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 5257d80e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -257,6 +257,11 @@ static int prox_parse_report(struct platform_device *pdev,

	st->num_channels = index;

	st->scale_precision = hid_sensor_format_scale(hsdev->usage,
						      &st->prox_attr[0],
						      &st->scale_pre_decml,
						      &st->scale_post_decml);

	return 0;
}