summaryrefslogtreecommitdiff
path: root/drivers/iio/common
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-09-10 16:49:00 +0400
committerJonathan Cameron <jic23@kernel.org>2013-09-15 00:17:16 +0400
commit5bb8e72d5de375c855ce5ec9b818c7836feeb301 (patch)
treeedf1831d0bba26126d482119a1f92ae58bfe1eec /drivers/iio/common
parent362f2f8647cfa53e36bf910b42ad084674ade9dc (diff)
downloadlinux-5bb8e72d5de375c855ce5ec9b818c7836feeb301.tar.xz
iio: sensors-core: st: Clean-up error handling in st_sensors_read_info_raw()
Saving a few lines of code. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r--drivers/iio/common/st_sensors/st_sensors_core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index eb261a58fc68..793136aff390 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -352,28 +352,25 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev,
mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
err = -EBUSY;
- goto read_error;
+ goto out;
} else {
err = st_sensors_set_enable(indio_dev, true);
if (err < 0)
- goto read_error;
+ goto out;
msleep((sdata->sensor->bootime * 1000) / sdata->odr);
err = st_sensors_read_axis_data(indio_dev, ch, val);
if (err < 0)
- goto read_error;
+ goto out;
*val = *val >> ch->scan_type.shift;
err = st_sensors_set_enable(indio_dev, false);
}
+out:
mutex_unlock(&indio_dev->mlock);
return err;
-
-read_error:
- mutex_unlock(&indio_dev->mlock);
- return err;
}
EXPORT_SYMBOL(st_sensors_read_info_raw);