summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorIrina Tirdea <irina.tirdea@intel.com>2016-03-28 20:15:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-20 15:42:12 +0900
commit5a103e7d6bf05ff4d053ee73a001d255bbc8951a (patch)
tree60ec1a5f5aa67db1633c098b0652fe3b7c1cd0f5 /drivers/iio
parent82bd14ade909c156f297ad34f0e6935931c6149f (diff)
iio: gyro: bmg160: fix buffer read values
commit b475c59b113db1e66eb9527ffdec3c5241c847e5 upstream. When reading gyroscope axes using iio buffers, the values returned are always 0. In the interrupt handler, the return value of the read operation is returned to the user instead of the value read. Return the value read to the user. This is also fixed in commit 82d8e5da1a33 ("iio: accel: bmg160: optimize transfers in trigger handler"). Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/gyro/bmg160_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
index 02ff789852a0..0d3edf97ec3a 100644
--- a/drivers/iio/gyro/bmg160_core.c
+++ b/drivers/iio/gyro/bmg160_core.c
@@ -780,7 +780,7 @@ static irqreturn_t bmg160_trigger_handler(int irq, void *p)
mutex_unlock(&data->mutex);
goto err;
}
- data->buffer[i++] = ret;
+ data->buffer[i++] = val;
}
mutex_unlock(&data->mutex);