iio:st_sensors fix build when !CONFIG_IIO_TRIGGER
authorJonathan Cameron <jic23@kernel.org>
Sat, 9 Feb 2013 10:49:00 +0000 (10:49 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 9 Feb 2013 15:22:29 +0000 (15:22 +0000)
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>
drivers/iio/accel/st_accel_core.c
drivers/iio/accel/st_accel_i2c.c
drivers/iio/accel/st_accel_spi.c
drivers/iio/gyro/st_gyro_core.c
drivers/iio/gyro/st_gyro_i2c.c
drivers/iio/gyro/st_gyro_spi.c
drivers/iio/magnetometer/st_magn_core.c
drivers/iio/magnetometer/st_magn_i2c.c
drivers/iio/magnetometer/st_magn_spi.c

index a235de252a90bb6a567afa370e74e7f3b2bbbf0f..e0f5a3ceba5edee7ce96ed4736f0a4a5f94aa653 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/irq.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>
@@ -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;
        }
index 90b8ddfb61ed323207d7165909e75d39e4cb566e..ffc9d097e484b81a96b78fe422eb948b29a23f67 100644 (file)
@@ -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>
index dbd45c08711fd70ddf1e9804863ca7031c529561..22b35bfea7d2b9765bed7e72cd4070a398835ff6 100644 (file)
@@ -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>
index 0a09998276c01694fda5ec644465b385466a82c6..fa9b242199870facf4157251774268456cb81509 100644 (file)
@@ -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;
        }
index a44b5b4a20136abe7b1d61cd3e1aa514af0e98b5..8a310500573d964b7b5b8b164e8c4aab31b22a85 100644 (file)
@@ -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>
index 8b4dcc5eab0c547b42d2e45935b7d7f1a421a949..f3540390eb22047ab6e11a95a449436ad15a86a2 100644 (file)
@@ -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>
index a69fbe19fc8e995a53cc57d987669d9b41ea5b2d..16f0d6df239f0be75e64c388b38b3760ace5d901 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/delay.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
-#include <linux/iio/trigger_consumer.h>
 #include <linux/iio/buffer.h>
 
 #include <linux/iio/common/st_sensors.h>
index 710b256a5a0ea0dbb1fd7c43000603a24bd0f40d..e6adc4a8642519c69c96de7b93b71856cd757c47 100644 (file)
@@ -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>
index 94547e7d65808d7896d82266b7bac59bc6d49924..51adb797cb7d7621ae6bf863fd73e90cc8fa1b42 100644 (file)
@@ -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>