From: Peter Meerwald Date: Tue, 3 Sep 2013 01:05:00 +0000 (+0100) Subject: staging:iio:hmc5843: Fix measurement conversion X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=575a6c90c190efabc829a8a9109f5036edaf1a82;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging:iio:hmc5843: Fix measurement conversion recently broken, cd6fe06588423ff4cca85c85c4402027b04dccf1 staging:iio:hmc5843: Use i2c_smbus_read_word_swapped() Signed-off-by: Peter Meerwald Signed-off-by: Jonathan Cameron --- diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index d2748c329eae..c3f3f539e787 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ b/drivers/staging/iio/magnetometer/hmc5843.c @@ -229,7 +229,7 @@ static int hmc5843_read_measurement(struct iio_dev *indio_dev, if (result < 0) return -EINVAL; - *val = result; + *val = sign_extend32(result, 15); return IIO_VAL_INT; }