iio: imu: st_lsm6dsx: grab conf mutex in st_lsm6dsx_write_event_config

Always grub conf mutex in st_lsm6dsx_write_event_config since it can run
concurrently with FIFO configuration

Fixes: b5969abfa8 ("iio: imu: st_lsm6dsx: add motion events")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Lorenzo Bianconi 2019-10-06 15:22:02 +02:00 committed by Jonathan Cameron
parent 04ca37d5ad
commit d278d44794

View file

@ -1619,7 +1619,9 @@ static int st_lsm6dsx_write_event_config(struct iio_dev *iio_dev,
if (err < 0)
return err;
mutex_lock(&hw->conf_lock);
err = st_lsm6dsx_sensor_set_enable(sensor, state);
mutex_unlock(&hw->conf_lock);
if (err < 0)
return err;