From 8ce4a56a52bf566659768a9e46e759e7cd5f33d9 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Sat, 9 Feb 2013 10:49:00 +0000 Subject: iio:st_sensors fix build when !CONFIG_IIO_TRIGGER Partly a case of removing unused headers and partly a case of ifdefing out the iio_trigger_ops structures. This has come about because of an 'unusual' separation of code in this driver. Signed-off-by: Jonathan Cameron Reported-by: Randy Dunlap Acked-by: Denis Ciocca --- drivers/iio/accel/st_accel_core.c | 9 +++++++-- drivers/iio/accel/st_accel_i2c.c | 1 - drivers/iio/accel/st_accel_spi.c | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/iio/accel') diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index a235de252a90..e0f5a3ceba5e 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 90b8ddfb61ed..ffc9d097e484 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 dbd45c08711f..22b35bfea7d2 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 -- cgit v1.2.3