summaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer/ak8975.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-07-14 18:13:41 +0200
committerTakashi Iwai <tiwai@suse.de>2014-07-14 18:13:41 +0200
commit03fe805a098422d27cbbbad29a54ff1349da3622 (patch)
tree0db9cc9a701203ddcee58e5b907d4fb8ad31b421 /drivers/iio/magnetometer/ak8975.c
parent50dd9050e45ce11c575eabcaee8a914caf78fb74 (diff)
parent5646eda5851e6cfdfa22d41895e3f5daffa643d3 (diff)
Merge branch 'topic/monotonic' into for-next
Diffstat (limited to 'drivers/iio/magnetometer/ak8975.c')
-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 09ea5c481f4..ea08313af0d 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: