iio: hid-sensor-prox: Fix scale not correct issue
authorYe Xiang <xiang.ye@intel.com>
Sat, 30 Jan 2021 10:25:30 +0000 (18:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Apr 2021 09:59:05 +0000 (11:59 +0200)
commit75a4fdb12969758f7c88da1010d8b1f85d625795
tree092c2e473236d79b65baeb605b3b3eee375c48e9
parentaa0ef53e0f439af6f916a78fd2757bf5225c36eb
iio: hid-sensor-prox: Fix scale not correct issue

commit d68c592e02f6f49a88e705f13dfc1883432cf300 upstream

Currently, the proxy sensor scale is zero because it just return the
exponent directly. To fix this issue, this patch use
hid_sensor_format_scale to process the scale first then return the
output.

Fixes: 39a3a0138f61 ("iio: hid-sensors: Added Proximity Sensor Driver")
Signed-off-by: Ye Xiang <xiang.ye@intel.com>
Link: https://lore.kernel.org/r/20210130102530.31064-1-xiang.ye@intel.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[sudip: adjust context]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/light/hid-sensor-prox.c