diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 10:49:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 15:22:29 (GMT) |
commit | 8ce4a56a52bf566659768a9e46e759e7cd5f33d9 (patch) | |
tree | 427bc7884341bebc2fb5f96e3ebf1beb892a790e /drivers/iio/gyro | |
parent | aaa300262c5912bda34c9cf871719209eae01b06 (diff) | |
download | linux-8ce4a56a52bf566659768a9e46e759e7cd5f33d9.tar.xz |
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 <jic23@kernel.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r-- | drivers/iio/gyro/st_gyro_core.c | 9 | ||||
-rw-r--r-- | drivers/iio/gyro/st_gyro_i2c.c | 1 | ||||
-rw-r--r-- | drivers/iio/gyro/st_gyro_spi.c | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c index 0a09998..fa9b242 100644 --- a/drivers/iio/gyro/st_gyro_core.c +++ b/drivers/iio/gyro/st_gyro_core.c @@ -21,7 +21,7 @@ #include <linux/delay.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> -#include <linux/iio/trigger_consumer.h> +#include <linux/iio/trigger.h> #include <linux/iio/buffer.h> #include <linux/iio/common/st_sensors.h> @@ -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 a44b5b4..8a31050 100644 --- a/drivers/iio/gyro/st_gyro_i2c.c +++ b/drivers/iio/gyro/st_gyro_i2c.c @@ -13,7 +13,6 @@ #include <linux/slab.h> #include <linux/i2c.h> #include <linux/iio/iio.h> -#include <linux/iio/trigger.h> #include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors_i2c.h> diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c index 8b4dcc5..f354039 100644 --- a/drivers/iio/gyro/st_gyro_spi.c +++ b/drivers/iio/gyro/st_gyro_spi.c @@ -13,7 +13,6 @@ #include <linux/slab.h> #include <linux/spi/spi.h> #include <linux/iio/iio.h> -#include <linux/iio/trigger.h> #include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors_spi.h> |