* [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER
@ 2013-02-09 10:49 Jonathan Cameron
2013-02-09 10:49 ` [PATCH 1/2] iio:triggers Protect functions in triggers.h from use when not compiled Jonathan Cameron
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jonathan Cameron @ 2013-02-09 10:49 UTC (permalink / raw)
To: linux-iio; +Cc: rdunlap, denis.ciocca, Jonathan Cameron
Here is how I would suggest dealing with the issues pointed out by
Randy when buildling without trigger support.
Jonathan
Jonathan Cameron (2):
iio:triggers Protect functions in triggers.h from use when not
compiled
iio:st_sensors fix build when !CONFIG_IIO_TRIGGER
drivers/iio/accel/st_accel_core.c | 9 +++++++--
drivers/iio/accel/st_accel_i2c.c | 1 -
drivers/iio/accel/st_accel_spi.c | 1 -
drivers/iio/gyro/st_gyro_core.c | 9 +++++++--
drivers/iio/gyro/st_gyro_i2c.c | 1 -
drivers/iio/gyro/st_gyro_spi.c | 1 -
drivers/iio/magnetometer/st_magn_core.c | 1 -
drivers/iio/magnetometer/st_magn_i2c.c | 1 -
drivers/iio/magnetometer/st_magn_spi.c | 1 -
include/linux/iio/trigger.h | 5 +++++
10 files changed, 19 insertions(+), 11 deletions(-)
--
1.8.1.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] iio:triggers Protect functions in triggers.h from use when not compiled 2013-02-09 10:49 [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron @ 2013-02-09 10:49 ` Jonathan Cameron 2013-02-09 10:49 ` [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER Jonathan Cameron 2013-02-09 15:25 ` [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron 2 siblings, 0 replies; 6+ messages in thread From: Jonathan Cameron @ 2013-02-09 10:49 UTC (permalink / raw) To: linux-iio; +Cc: rdunlap, denis.ciocca, Jonathan Cameron Also include a couple of forward defs of struct iio_trigger and struct iio_trigger_ops to avoid doing this in each driver. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reported-by: Randy Dunlap <rdunlap@infradead.org> --- include/linux/iio/trigger.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 20239da..c66e0a9 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h @@ -12,6 +12,7 @@ #ifndef _IIO_TRIGGER_H_ #define _IIO_TRIGGER_H_ +#ifdef CONFIG_IIO_TRIGGER struct iio_subirq { bool enabled; }; @@ -117,4 +118,8 @@ irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); __printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...); void iio_trigger_free(struct iio_trigger *trig); +#else +struct iio_trigger; +struct iio_trigger_ops; +#endif #endif /* _IIO_TRIGGER_H_ */ -- 1.8.1.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER 2013-02-09 10:49 [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron 2013-02-09 10:49 ` [PATCH 1/2] iio:triggers Protect functions in triggers.h from use when not compiled Jonathan Cameron @ 2013-02-09 10:49 ` Jonathan Cameron 2013-02-09 11:53 ` Denis Ciocca 2013-02-09 15:25 ` [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron 2 siblings, 1 reply; 6+ messages in thread From: Jonathan Cameron @ 2013-02-09 10:49 UTC (permalink / raw) To: linux-iio; +Cc: rdunlap, denis.ciocca, Jonathan Cameron 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> --- drivers/iio/accel/st_accel_core.c | 9 +++++++-- drivers/iio/accel/st_accel_i2c.c | 1 - drivers/iio/accel/st_accel_spi.c | 1 - drivers/iio/gyro/st_gyro_core.c | 9 +++++++-- drivers/iio/gyro/st_gyro_i2c.c | 1 - drivers/iio/gyro/st_gyro_spi.c | 1 - drivers/iio/magnetometer/st_magn_core.c | 1 - drivers/iio/magnetometer/st_magn_i2c.c | 1 - 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 a235de2..e0f5a3c 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -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; } diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c index 90b8ddf..ffc9d09 100644 --- a/drivers/iio/accel/st_accel_i2c.c +++ b/drivers/iio/accel/st_accel_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/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c index dbd45c0..22b35bf 100644 --- a/drivers/iio/accel/st_accel_spi.c +++ b/drivers/iio/accel/st_accel_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> 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> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index a69fbe1..16f0d6d 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c @@ -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> diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c index 710b256a5..e6adc4a 100644 --- a/drivers/iio/magnetometer/st_magn_i2c.c +++ b/drivers/iio/magnetometer/st_magn_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/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c index 94547e7..51adb79 100644 --- a/drivers/iio/magnetometer/st_magn_spi.c +++ b/drivers/iio/magnetometer/st_magn_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> -- 1.8.1.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER 2013-02-09 10:49 ` [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER Jonathan Cameron @ 2013-02-09 11:53 ` Denis Ciocca 2013-02-09 15:24 ` Jonathan Cameron 0 siblings, 1 reply; 6+ messages in thread From: Denis Ciocca @ 2013-02-09 11:53 UTC (permalink / raw) To: Jonathan Cameron; +Cc: linux-iio@vger.kernel.org, Randy Dunlap, Denis CIOCCA > 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. Ok for me is ok. Thanks Jonathan & Randy > Signed-off-by: Jonathan Cameron <jic23@kernel.org> > Reported-by: Randy Dunlap <rdunlap@infradead.org> > --- > drivers/iio/accel/st_accel_core.c | 9 +++++++-- > drivers/iio/accel/st_accel_i2c.c | 1 - > drivers/iio/accel/st_accel_spi.c | 1 - > drivers/iio/gyro/st_gyro_core.c | 9 +++++++-- > drivers/iio/gyro/st_gyro_i2c.c | 1 - > drivers/iio/gyro/st_gyro_spi.c | 1 - > drivers/iio/magnetometer/st_magn_core.c | 1 - > drivers/iio/magnetometer/st_magn_i2c.c | 1 - > 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 a235de2..e0f5a3c 100644 > --- a/drivers/iio/accel/st_accel_core.c > +++ b/drivers/iio/accel/st_accel_core.c > @@ -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; > } > diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c > index 90b8ddf..ffc9d09 100644 > --- a/drivers/iio/accel/st_accel_i2c.c > +++ b/drivers/iio/accel/st_accel_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/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c > index dbd45c0..22b35bf 100644 > --- a/drivers/iio/accel/st_accel_spi.c > +++ b/drivers/iio/accel/st_accel_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> > 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> > diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c > index a69fbe1..16f0d6d 100644 > --- a/drivers/iio/magnetometer/st_magn_core.c > +++ b/drivers/iio/magnetometer/st_magn_core.c > @@ -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> > diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c > index 710b256a5..e6adc4a 100644 > --- a/drivers/iio/magnetometer/st_magn_i2c.c > +++ b/drivers/iio/magnetometer/st_magn_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/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c > index 94547e7..51adb79 100644 > --- a/drivers/iio/magnetometer/st_magn_spi.c > +++ b/drivers/iio/magnetometer/st_magn_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> > -- > 1.8.1.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER 2013-02-09 11:53 ` Denis Ciocca @ 2013-02-09 15:24 ` Jonathan Cameron 0 siblings, 0 replies; 6+ messages in thread From: Jonathan Cameron @ 2013-02-09 15:24 UTC (permalink / raw) To: Denis Ciocca; +Cc: linux-iio@vger.kernel.org, Randy Dunlap, Denis CIOCCA On 02/09/2013 11:53 AM, Denis Ciocca wrote: >> 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. > > Ok for me is ok. > > Thanks Jonathan & Randy I'll take that as an Acked-by: > > > >> Signed-off-by: Jonathan Cameron <jic23@kernel.org> >> Reported-by: Randy Dunlap <rdunlap@infradead.org> >> --- >> drivers/iio/accel/st_accel_core.c | 9 +++++++-- >> drivers/iio/accel/st_accel_i2c.c | 1 - >> drivers/iio/accel/st_accel_spi.c | 1 - >> drivers/iio/gyro/st_gyro_core.c | 9 +++++++-- >> drivers/iio/gyro/st_gyro_i2c.c | 1 - >> drivers/iio/gyro/st_gyro_spi.c | 1 - >> drivers/iio/magnetometer/st_magn_core.c | 1 - >> drivers/iio/magnetometer/st_magn_i2c.c | 1 - >> 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 a235de2..e0f5a3c 100644 >> --- a/drivers/iio/accel/st_accel_core.c >> +++ b/drivers/iio/accel/st_accel_core.c >> @@ -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; >> } >> diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c >> index 90b8ddf..ffc9d09 100644 >> --- a/drivers/iio/accel/st_accel_i2c.c >> +++ b/drivers/iio/accel/st_accel_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/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c >> index dbd45c0..22b35bf 100644 >> --- a/drivers/iio/accel/st_accel_spi.c >> +++ b/drivers/iio/accel/st_accel_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> >> 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> >> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c >> index a69fbe1..16f0d6d 100644 >> --- a/drivers/iio/magnetometer/st_magn_core.c >> +++ b/drivers/iio/magnetometer/st_magn_core.c >> @@ -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> >> diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c >> index 710b256a5..e6adc4a 100644 >> --- a/drivers/iio/magnetometer/st_magn_i2c.c >> +++ b/drivers/iio/magnetometer/st_magn_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/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c >> index 94547e7..51adb79 100644 >> --- a/drivers/iio/magnetometer/st_magn_spi.c >> +++ b/drivers/iio/magnetometer/st_magn_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> >> -- >> 1.8.1.1 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-iio" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER 2013-02-09 10:49 [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron 2013-02-09 10:49 ` [PATCH 1/2] iio:triggers Protect functions in triggers.h from use when not compiled Jonathan Cameron 2013-02-09 10:49 ` [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER Jonathan Cameron @ 2013-02-09 15:25 ` Jonathan Cameron 2 siblings, 0 replies; 6+ messages in thread From: Jonathan Cameron @ 2013-02-09 15:25 UTC (permalink / raw) To: Jonathan Cameron; +Cc: linux-iio, rdunlap, denis.ciocca On 02/09/2013 10:49 AM, Jonathan Cameron wrote: > Here is how I would suggest dealing with the issues pointed out by > Randy when buildling without trigger support. > Applied to togreg branch of iio.git > Jonathan > > Jonathan Cameron (2): > iio:triggers Protect functions in triggers.h from use when not > compiled > iio:st_sensors fix build when !CONFIG_IIO_TRIGGER > > drivers/iio/accel/st_accel_core.c | 9 +++++++-- > drivers/iio/accel/st_accel_i2c.c | 1 - > drivers/iio/accel/st_accel_spi.c | 1 - > drivers/iio/gyro/st_gyro_core.c | 9 +++++++-- > drivers/iio/gyro/st_gyro_i2c.c | 1 - > drivers/iio/gyro/st_gyro_spi.c | 1 - > drivers/iio/magnetometer/st_magn_core.c | 1 - > drivers/iio/magnetometer/st_magn_i2c.c | 1 - > drivers/iio/magnetometer/st_magn_spi.c | 1 - > include/linux/iio/trigger.h | 5 +++++ > 10 files changed, 19 insertions(+), 11 deletions(-) > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-02-09 15:25 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-02-09 10:49 [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron 2013-02-09 10:49 ` [PATCH 1/2] iio:triggers Protect functions in triggers.h from use when not compiled Jonathan Cameron 2013-02-09 10:49 ` [PATCH 2/2] iio:st_sensors fix build when !CONFIG_IIO_TRIGGER Jonathan Cameron 2013-02-09 11:53 ` Denis Ciocca 2013-02-09 15:24 ` Jonathan Cameron 2013-02-09 15:25 ` [PATCH 0/2] iio:st_sensors more fixes when !IIO_CONFIG_TRIGGER Jonathan Cameron
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox