summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-22 20:33:51 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-22 20:33:51 +0400
commitef7994fa2aecd8d1fb0d75034caa050ff908d26a (patch)
treeaa7bbe9499256ced149dce70891de5eedf33c283 /drivers/iio/magnetometer
parentad8686bc05adc2b8301d749f5958bd904f3a46ee (diff)
parenta497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee (diff)
downloadlinux-ef7994fa2aecd8d1fb0d75034caa050ff908d26a.tar.xz
Merge 3.16-rc2 into staging-next
We want the staging fixes here as well.
Diffstat (limited to 'drivers/iio/magnetometer')
-rw-r--r--drivers/iio/magnetometer/ak8975.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 09ea5c481f4c..ea08313af0d2 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -373,8 +373,6 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
{
struct ak8975_data *data = iio_priv(indio_dev);
struct i2c_client *client = data->client;
- u16 meas_reg;
- s16 raw;
int ret;
mutex_lock(&data->lock);
@@ -422,16 +420,11 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
dev_err(&client->dev, "Read axis data fails\n");
goto exit;
}
- meas_reg = ret;
mutex_unlock(&data->lock);
- /* Endian conversion of the measured values. */
- raw = (s16) (le16_to_cpu(meas_reg));
-
/* Clamp to valid range. */
- raw = clamp_t(s16, raw, -4096, 4095);
- *val = raw;
+ *val = clamp_t(s16, ret, -4096, 4095);
return IIO_VAL_INT;
exit: