Commit 8ce4a56a authored by Jonathan Cameron's avatar Jonathan Cameron

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: default avatarJonathan Cameron <jic23@kernel.org>
Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarDenis Ciocca <denis.ciocca@st.com>
parent aaa30026
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/sysfs.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/buffer.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
...@@ -419,10 +419,15 @@ static const struct iio_info accel_info = { ...@@ -419,10 +419,15 @@ static const struct iio_info accel_info = {
.write_raw = &st_accel_write_raw, .write_raw = &st_accel_write_raw,
}; };
#ifdef CONFIG_IIO_TRIGGER
static const struct iio_trigger_ops st_accel_trigger_ops = { static const struct iio_trigger_ops st_accel_trigger_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.set_trigger_state = ST_ACCEL_TRIGGER_SET_STATE, .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) int st_accel_common_probe(struct iio_dev *indio_dev)
{ {
...@@ -455,7 +460,7 @@ 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; goto st_accel_common_probe_error;
err = st_sensors_allocate_trigger(indio_dev, err = st_sensors_allocate_trigger(indio_dev,
&st_accel_trigger_ops); ST_ACCEL_TRIGGER_OPS);
if (err < 0) if (err < 0)
goto st_accel_probe_trigger_error; goto st_accel_probe_trigger_error;
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
#include <linux/iio/common/st_sensors_i2c.h> #include <linux/iio/common/st_sensors_i2c.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
#include <linux/iio/common/st_sensors_spi.h> #include <linux/iio/common/st_sensors_spi.h>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/sysfs.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/buffer.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
...@@ -287,10 +287,15 @@ static const struct iio_info gyro_info = { ...@@ -287,10 +287,15 @@ static const struct iio_info gyro_info = {
.write_raw = &st_gyro_write_raw, .write_raw = &st_gyro_write_raw,
}; };
#ifdef CONFIG_IIO_TRIGGER
static const struct iio_trigger_ops st_gyro_trigger_ops = { static const struct iio_trigger_ops st_gyro_trigger_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.set_trigger_state = ST_GYRO_TRIGGER_SET_STATE, .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) int st_gyro_common_probe(struct iio_dev *indio_dev)
{ {
...@@ -323,7 +328,7 @@ 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; goto st_gyro_common_probe_error;
err = st_sensors_allocate_trigger(indio_dev, err = st_sensors_allocate_trigger(indio_dev,
&st_gyro_trigger_ops); ST_GYRO_TRIGGER_OPS);
if (err < 0) if (err < 0)
goto st_gyro_probe_trigger_error; goto st_gyro_probe_trigger_error;
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
#include <linux/iio/common/st_sensors_i2c.h> #include <linux/iio/common/st_sensors_i2c.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
#include <linux/iio/common/st_sensors_spi.h> #include <linux/iio/common/st_sensors_spi.h>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/sysfs.h> #include <linux/iio/sysfs.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/buffer.h> #include <linux/iio/buffer.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
#include <linux/iio/common/st_sensors_i2c.h> #include <linux/iio/common/st_sensors_i2c.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/trigger.h>
#include <linux/iio/common/st_sensors.h> #include <linux/iio/common/st_sensors.h>
#include <linux/iio/common/st_sensors_spi.h> #include <linux/iio/common/st_sensors_spi.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment