summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLuis de Bethencourt <luisbg@osg.samsung.com>2016-06-22 20:43:30 +0100
committerJonathan Cameron <jic23@kernel.org>2016-06-26 15:57:02 +0100
commitef3149eb3ddb7f9125e11c90f8330e371b55cffd (patch)
treeeec87d6d485fd16bf9b4bca1c55dfbb66c1eb0ac /drivers/staging
parentdf013212a1b6557f071609983cab0612f71fd99b (diff)
downloadlinux-ef3149eb3ddb7f9125e11c90f8330e371b55cffd.tar.bz2
staging: iio: accel: fix error check
sca3000_read_ctrl_reg() returns a negative number on failure, check for this instead of zero. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/iio/accel/sca3000_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index a8f533af9eca..ec12181822e6 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -594,7 +594,7 @@ static ssize_t sca3000_read_frequency(struct device *dev,
goto error_ret_mut;
ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL);
mutex_unlock(&st->lock);
- if (ret)
+ if (ret < 0)
goto error_ret;
val = ret;
if (base_freq > 0)