diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index a235de252a90bb6a567afa370e74e7f3b2bbbf0f..e0f5a3ceba5edee7ce96ed4736f0a4a5f94aa653 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include @@ -419,10 +419,15 @@ static const struct iio_info accel_info = { .write_raw = &st_accel_write_raw, }; +#ifdef CONFIG_IIO_TRIGGER static const struct iio_trigger_ops st_accel_trigger_ops = { .owner = THIS_MODULE, .set_trigger_state = ST_ACCEL_TRIGGER_SET_STATE, }; +#define ST_ACCEL_TRIGGER_OPS (&st_accel_trigger_ops) +#else +#define ST_ACCEL_TRIGGER_OPS NULL +#endif int st_accel_common_probe(struct iio_dev *indio_dev) { @@ -455,7 +460,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev) goto st_accel_common_probe_error; err = st_sensors_allocate_trigger(indio_dev, - &st_accel_trigger_ops); + ST_ACCEL_TRIGGER_OPS); if (err < 0) goto st_accel_probe_trigger_error; } diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c index 90b8ddfb61ed323207d7165909e75d39e4cb566e..ffc9d097e484b81a96b78fe422eb948b29a23f67 100644 --- a/drivers/iio/accel/st_accel_i2c.c +++ b/drivers/iio/accel/st_accel_i2c.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c index dbd45c08711fd70ddf1e9804863ca7031c529561..22b35bfea7d2b9765bed7e72cd4070a398835ff6 100644 --- a/drivers/iio/accel/st_accel_spi.c +++ b/drivers/iio/accel/st_accel_spi.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c index 0a09998276c01694fda5ec644465b385466a82c6..fa9b242199870facf4157251774268456cb81509 100644 --- a/drivers/iio/gyro/st_gyro_core.c +++ b/drivers/iio/gyro/st_gyro_core.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -287,10 +287,15 @@ static const struct iio_info gyro_info = { .write_raw = &st_gyro_write_raw, }; +#ifdef CONFIG_IIO_TRIGGER static const struct iio_trigger_ops st_gyro_trigger_ops = { .owner = THIS_MODULE, .set_trigger_state = ST_GYRO_TRIGGER_SET_STATE, }; +#define ST_GYRO_TRIGGER_OPS (&st_gyro_trigger_ops) +#else +#define ST_GYRO_TRIGGER_OPS NULL +#endif int st_gyro_common_probe(struct iio_dev *indio_dev) { @@ -323,7 +328,7 @@ int st_gyro_common_probe(struct iio_dev *indio_dev) goto st_gyro_common_probe_error; err = st_sensors_allocate_trigger(indio_dev, - &st_gyro_trigger_ops); + ST_GYRO_TRIGGER_OPS); if (err < 0) goto st_gyro_probe_trigger_error; } diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c index a44b5b4a20136abe7b1d61cd3e1aa514af0e98b5..8a310500573d964b7b5b8b164e8c4aab31b22a85 100644 --- a/drivers/iio/gyro/st_gyro_i2c.c +++ b/drivers/iio/gyro/st_gyro_i2c.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c index 8b4dcc5eab0c547b42d2e45935b7d7f1a421a949..f3540390eb22047ab6e11a95a449436ad15a86a2 100644 --- a/drivers/iio/gyro/st_gyro_spi.c +++ b/drivers/iio/gyro/st_gyro_spi.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index a69fbe19fc8e995a53cc57d987669d9b41ea5b2d..16f0d6df239f0be75e64c388b38b3760ace5d901 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c index 710b256a5a0ea0dbb1fd7c43000603a24bd0f40d..e6adc4a8642519c69c96de7b93b71856cd757c47 100644 --- a/drivers/iio/magnetometer/st_magn_i2c.c +++ b/drivers/iio/magnetometer/st_magn_i2c.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c index 94547e7d65808d7896d82266b7bac59bc6d49924..51adb797cb7d7621ae6bf863fd73e90cc8fa1b42 100644 --- a/drivers/iio/magnetometer/st_magn_spi.c +++ b/drivers/iio/magnetometer/st_magn_spi.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include