]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: hid-sensor-prox: Fix incorrect OFFSET calculation
authorZhang Lixu <lixu.zhang@intel.com>
Thu, 24 Jul 2025 15:36:40 +0000 (11:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2025 08:47:32 +0000 (09:47 +0100)
commita56b79a43f83ee1cd830662c85b1fc7bc9daaf75
tree45cfc80ba88557a94ecf17a0e82c8a4114861327
parent796c96cf668553dbb12049738a8f7d83b26092e1
iio: hid-sensor-prox: Fix incorrect OFFSET calculation

[ Upstream commit 79dabbd505210e41c88060806c92c052496dd61c ]

The OFFSET calculation in the prox_read_raw() was incorrectly using the
unit exponent, which is intended for SCALE calculations.

Remove the incorrect OFFSET calculation and set it to a fixed value of 0.

Cc: stable@vger.kernel.org
Fixes: 39a3a0138f61 ("iio: hid-sensors: Added Proximity Sensor Driver")
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/20250331055022.1149736-4-lixu.zhang@intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[ adapted prox_attr array access to single structure member access ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/light/hid-sensor-prox.c