staging:iio:hmc5843: Fix measurement conversion
authorPeter Meerwald <pmeerw@pmeerw.net>
Tue, 3 Sep 2013 01:05:00 +0000 (02:05 +0100)
committerJonathan Cameron <jic23@kernel.org>
Wed, 18 Sep 2013 18:43:30 +0000 (19:43 +0100)
recently broken, cd6fe06588423ff4cca85c85c4402027b04dccf1
staging:iio:hmc5843: Use i2c_smbus_read_word_swapped()

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/magnetometer/hmc5843.c

index d2748c329eae6728b9c88c6b3a63065982d78555..c3f3f539e787e926b54f793958d8e9dac13aa6d7 100644 (file)
@@ -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;
 }