From: Daniel Baluta Date: Thu, 11 Jun 2015 15:49:34 +0000 (+0300) Subject: iio: proximity: sx9500: Fix proximity value X-Git-Tag: v4.2-rc3~15^2~3^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fd1883f07cb434707e50c4c9a16e3ed4b3a5e74f;p=karo-tx-linux.git iio: proximity: sx9500: Fix proximity value Because of the ABI confusion proximity value exposed by SX9500 was inverted. Signed-off-by: Daniel Baluta Reviewed-by: Vlad Dogaru Cc: Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c index fa40f6d0ca39..bd26a484abcc 100644 --- a/drivers/iio/proximity/sx9500.c +++ b/drivers/iio/proximity/sx9500.c @@ -206,7 +206,7 @@ static int sx9500_read_proximity(struct sx9500_data *data, if (ret < 0) return ret; - *val = 32767 - (s16)be16_to_cpu(regval); + *val = be16_to_cpu(regval); return IIO_VAL_INT; }