diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 05:49:00 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 10:22:29 -0500 |
commit | 8ce4a56a52bf566659768a9e46e759e7cd5f33d9 (patch) | |
tree | 427bc7884341bebc2fb5f96e3ebf1beb892a790e | |
parent | aaa300262c5912bda34c9cf871719209eae01b06 (diff) |
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>
-rw-r--r-- | drivers/iio/accel/st_accel_core.c | 9 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_i2c.c | 1 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_spi.c | 1 | ||||
-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 | ||||
-rw-r--r-- | drivers/iio/magnetometer/st_magn_core.c | 1 | ||||
-rw-r--r-- | drivers/iio/magnetometer/st_magn_i2c.c | 1 | ||||
-rw-r--r-- | drivers/iio/magnetometer/st_magn_spi.c | 1 |
9 files changed, 14 insertions, 11 deletions
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 @@ | |||
20 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
21 | #include <linux/iio/iio.h> | 21 | #include <linux/iio/iio.h> |
22 | #include <linux/iio/sysfs.h> | 22 | #include <linux/iio/sysfs.h> |
23 | #include <linux/iio/trigger_consumer.h> | 23 | #include <linux/iio/trigger.h> |
24 | #include <linux/iio/buffer.h> | 24 | #include <linux/iio/buffer.h> |
25 | 25 | ||
26 | #include <linux/iio/common/st_sensors.h> | 26 | #include <linux/iio/common/st_sensors.h> |
@@ -419,10 +419,15 @@ static const struct iio_info accel_info = { | |||
419 | .write_raw = &st_accel_write_raw, | 419 | .write_raw = &st_accel_write_raw, |
420 | }; | 420 | }; |
421 | 421 | ||
422 | #ifdef CONFIG_IIO_TRIGGER | ||
422 | static const struct iio_trigger_ops st_accel_trigger_ops = { | 423 | static const struct iio_trigger_ops st_accel_trigger_ops = { |
423 | .owner = THIS_MODULE, | 424 | .owner = THIS_MODULE, |
424 | .set_trigger_state = ST_ACCEL_TRIGGER_SET_STATE, | 425 | .set_trigger_state = ST_ACCEL_TRIGGER_SET_STATE, |
425 | }; | 426 | }; |
427 | #define ST_ACCEL_TRIGGER_OPS (&st_accel_trigger_ops) | ||
428 | #else | ||
429 | #define ST_ACCEL_TRIGGER_OPS NULL | ||
430 | #endif | ||
426 | 431 | ||
427 | int st_accel_common_probe(struct iio_dev *indio_dev) | 432 | int st_accel_common_probe(struct iio_dev *indio_dev) |
428 | { | 433 | { |
@@ -455,7 +460,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev) | |||
455 | goto st_accel_common_probe_error; | 460 | goto st_accel_common_probe_error; |
456 | 461 | ||
457 | err = st_sensors_allocate_trigger(indio_dev, | 462 | err = st_sensors_allocate_trigger(indio_dev, |
458 | &st_accel_trigger_ops); | 463 | ST_ACCEL_TRIGGER_OPS); |
459 | if (err < 0) | 464 | if (err < 0) |
460 | goto st_accel_probe_trigger_error; | 465 | goto st_accel_probe_trigger_error; |
461 | } | 466 | } |
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 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/iio/iio.h> | 15 | #include <linux/iio/iio.h> |
16 | #include <linux/iio/trigger.h> | ||
17 | 16 | ||
18 | #include <linux/iio/common/st_sensors.h> | 17 | #include <linux/iio/common/st_sensors.h> |
19 | #include <linux/iio/common/st_sensors_i2c.h> | 18 | #include <linux/iio/common/st_sensors_i2c.h> |
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 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/spi/spi.h> | 14 | #include <linux/spi/spi.h> |
15 | #include <linux/iio/iio.h> | 15 | #include <linux/iio/iio.h> |
16 | #include <linux/iio/trigger.h> | ||
17 | 16 | ||
18 | #include <linux/iio/common/st_sensors.h> | 17 | #include <linux/iio/common/st_sensors.h> |
19 | #include <linux/iio/common/st_sensors_spi.h> | 18 | #include <linux/iio/common/st_sensors_spi.h> |
diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c index 0a09998276c0..fa9b24219987 100644 --- a/drivers/iio/gyro/st_gyro_core.c +++ b/drivers/iio/gyro/st_gyro_core.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/iio/iio.h> | 22 | #include <linux/iio/iio.h> |
23 | #include <linux/iio/sysfs.h> | 23 | #include <linux/iio/sysfs.h> |
24 | #include <linux/iio/trigger_consumer.h> | 24 | #include <linux/iio/trigger.h> |
25 | #include <linux/iio/buffer.h> | 25 | #include <linux/iio/buffer.h> |
26 | 26 | ||
27 | #include <linux/iio/common/st_sensors.h> | 27 | #include <linux/iio/common/st_sensors.h> |
@@ -287,10 +287,15 @@ static const struct iio_info gyro_info = { | |||
287 | .write_raw = &st_gyro_write_raw, | 287 | .write_raw = &st_gyro_write_raw, |
288 | }; | 288 | }; |
289 | 289 | ||
290 | #ifdef CONFIG_IIO_TRIGGER | ||
290 | static const struct iio_trigger_ops st_gyro_trigger_ops = { | 291 | static const struct iio_trigger_ops st_gyro_trigger_ops = { |
291 | .owner = THIS_MODULE, | 292 | .owner = THIS_MODULE, |
292 | .set_trigger_state = ST_GYRO_TRIGGER_SET_STATE, | 293 | .set_trigger_state = ST_GYRO_TRIGGER_SET_STATE, |
293 | }; | 294 | }; |
295 | #define ST_GYRO_TRIGGER_OPS (&st_gyro_trigger_ops) | ||
296 | #else | ||
297 | #define ST_GYRO_TRIGGER_OPS NULL | ||
298 | #endif | ||
294 | 299 | ||
295 | int st_gyro_common_probe(struct iio_dev *indio_dev) | 300 | int st_gyro_common_probe(struct iio_dev *indio_dev) |
296 | { | 301 | { |
@@ -323,7 +328,7 @@ int st_gyro_common_probe(struct iio_dev *indio_dev) | |||
323 | goto st_gyro_common_probe_error; | 328 | goto st_gyro_common_probe_error; |
324 | 329 | ||
325 | err = st_sensors_allocate_trigger(indio_dev, | 330 | err = st_sensors_allocate_trigger(indio_dev, |
326 | &st_gyro_trigger_ops); | 331 | ST_GYRO_TRIGGER_OPS); |
327 | if (err < 0) | 332 | if (err < 0) |
328 | goto st_gyro_probe_trigger_error; | 333 | goto st_gyro_probe_trigger_error; |
329 | } | 334 | } |
diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c index a44b5b4a2013..8a310500573d 100644 --- a/drivers/iio/gyro/st_gyro_i2c.c +++ b/drivers/iio/gyro/st_gyro_i2c.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/iio/iio.h> | 15 | #include <linux/iio/iio.h> |
16 | #include <linux/iio/trigger.h> | ||
17 | 16 | ||
18 | #include <linux/iio/common/st_sensors.h> | 17 | #include <linux/iio/common/st_sensors.h> |
19 | #include <linux/iio/common/st_sensors_i2c.h> | 18 | #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 8b4dcc5eab0c..f3540390eb22 100644 --- a/drivers/iio/gyro/st_gyro_spi.c +++ b/drivers/iio/gyro/st_gyro_spi.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/spi/spi.h> | 14 | #include <linux/spi/spi.h> |
15 | #include <linux/iio/iio.h> | 15 | #include <linux/iio/iio.h> |
16 | #include <linux/iio/trigger.h> | ||
17 | 16 | ||
18 | #include <linux/iio/common/st_sensors.h> | 17 | #include <linux/iio/common/st_sensors.h> |
19 | #include <linux/iio/common/st_sensors_spi.h> | 18 | #include <linux/iio/common/st_sensors_spi.h> |
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index a69fbe19fc8e..16f0d6df239f 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/iio/iio.h> | 22 | #include <linux/iio/iio.h> |
23 | #include <linux/iio/sysfs.h> | 23 | #include <linux/iio/sysfs.h> |
24 | #include <linux/iio/trigger_consumer.h> | ||
25 | #include <linux/iio/buffer.h> | 24 | #include <linux/iio/buffer.h> |
26 | 25 | ||
27 | #include <linux/iio/common/st_sensors.h> | 26 | #include <linux/iio/common/st_sensors.h> |
diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c index 710b256a5a0e..e6adc4a86425 100644 --- a/drivers/iio/magnetometer/st_magn_i2c.c +++ b/drivers/iio/magnetometer/st_magn_i2c.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/iio/iio.h> | 15 | #include <linux/iio/iio.h> |
16 | #include <linux/iio/trigger.h> | ||
17 | 16 | ||
18 | #include <linux/iio/common/st_sensors.h> | 17 | #include <linux/iio/common/st_sensors.h> |
19 | #include <linux/iio/common/st_sensors_i2c.h> | 18 | #include <linux/iio/common/st_sensors_i2c.h> |
diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c index 94547e7d6580..51adb797cb7d 100644 --- a/drivers/iio/magnetometer/st_magn_spi.c +++ b/drivers/iio/magnetometer/st_magn_spi.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/spi/spi.h> | 14 | #include <linux/spi/spi.h> |
15 | #include <linux/iio/iio.h> | 15 | #include <linux/iio/iio.h> |
16 | #include <linux/iio/trigger.h> | ||
17 | 16 | ||
18 | #include <linux/iio/common/st_sensors.h> | 17 | #include <linux/iio/common/st_sensors.h> |
19 | #include <linux/iio/common/st_sensors_spi.h> | 18 | #include <linux/iio/common/st_sensors_spi.h> |