--- zzzz-none-000/linux-3.10.107/drivers/iio/magnetometer/st_magn_buffer.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/iio/magnetometer/st_magn_buffer.c 2021-02-04 17:41:59.000000000 +0000 @@ -23,18 +23,16 @@ #include #include "st_magn.h" -static int st_magn_buffer_preenable(struct iio_dev *indio_dev) +int st_magn_trig_set_state(struct iio_trigger *trig, bool state) { - int err; - - err = st_sensors_set_enable(indio_dev, true); - if (err < 0) - goto st_magn_set_enable_error; + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); - err = iio_sw_buffer_preenable(indio_dev); + return st_sensors_set_dataready_irq(indio_dev, state); +} -st_magn_set_enable_error: - return err; +static int st_magn_buffer_preenable(struct iio_dev *indio_dev) +{ + return st_sensors_set_enable(indio_dev, true); } static int st_magn_buffer_postenable(struct iio_dev *indio_dev)