]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: hid-sensor-prox: Fix incorrect OFFSET calculation
authorZhang Lixu <lixu.zhang@intel.com>
Mon, 31 Mar 2025 05:50:22 +0000 (13:50 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 7 Apr 2025 18:32:50 +0000 (19:32 +0100)
commit79dabbd505210e41c88060806c92c052496dd61c
tree2a51e15053642be626c73232485ba4a2fb8a4e0e
parent8b518cdb03f5f6e06d635cbfd9583d1fdbb39bfd
iio: hid-sensor-prox: Fix incorrect OFFSET calculation

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>
drivers/iio/light/hid-sensor-prox.c