staging:iio:hmc5843: Use i2c_smbus_read_word_swapped()
authorPeter Meerwald <pmeerw@pmeerw.net>
Sat, 27 Jul 2013 15:31:00 +0000 (16:31 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 4 Aug 2013 10:22:55 +0000 (11:22 +0100)
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/magnetometer/hmc5843.c

index 3204593c90d43f6d955f2f80cc073a012460dc10..d2748c329eae6728b9c88c6b3a63065982d78555 100644 (file)
@@ -224,12 +224,12 @@ static int hmc5843_read_measurement(struct iio_dev *indio_dev,
                return -EIO;
        }
 
-       result = i2c_smbus_read_word_data(client, address);
+       result = i2c_smbus_read_word_swapped(client, address);
        mutex_unlock(&data->lock);
        if (result < 0)
                return -EINVAL;
 
-       *val = (s16)swab16((u16)result);
+       *val = result;
        return IIO_VAL_INT;
 }