diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2018-11-11 15:15:32 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2018-11-16 18:32:33 +0000 |
commit | 1775044356c2f7f268e9c64d0c3fdd64588322e2 (patch) | |
tree | d27d99e896dec6adcb00ecbbfc4195c7dbaa86da /drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | |
parent | 6ffb55e5009ffdf103aa206511ea620490c0f002 (diff) | |
download | linux-1775044356c2f7f268e9c64d0c3fdd64588322e2.tar.bz2 |
iio: imu: st_lsm6dsx: introduce st_lsm6dsx_sensor_set_enable routine
Add st_lsm6dsx_sensor_set_enable routine and remove
st_lsm6dsx_sensor_{enable/disable} ones in order to make the code more
readable and remove unnecessary functions
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c')
-rw-r--r-- | drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c index f4804008b585..6a379767b919 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c @@ -579,15 +579,9 @@ static int st_lsm6dsx_update_fifo(struct iio_dev *iio_dev, bool enable) goto out; } - if (enable) { - err = st_lsm6dsx_sensor_enable(sensor); - if (err < 0) - goto out; - } else { - err = st_lsm6dsx_sensor_disable(sensor); - if (err < 0) - goto out; - } + err = st_lsm6dsx_sensor_set_enable(sensor, enable); + if (err < 0) + goto out; err = st_lsm6dsx_set_fifo_odr(sensor, enable); if (err < 0) |