mirror of
https://github.com/torvalds/linux.git
synced 2024-12-07 19:41:31 +00:00
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>
This commit is contained in:
parent
362f2f8647
commit
5bb8e72d5d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user