From: Denis CIOCCA Date: Thu, 7 Feb 2013 09:46:00 +0000 (+0000) Subject: iio:common: added allocate and deallocate trigger functions when trigger is disabled. X-Git-Tag: firefly_0821_release~3680^2~1080^2~53^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=91ffbabfd9ae6b9bfef02bb1e0fbba451c7289a7;p=firefly-linux-kernel-4.4.55.git iio:common: added allocate and deallocate trigger functions when trigger is disabled. This patch resolve a bugfix when driver is compiled without trigger. Signed-off-by: Denis Ciocca Reported-by: Randy Dunlap Signed-off-by: Jonathan Cameron --- diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index c40fdf537f69..1f86a97ab2e2 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h @@ -235,6 +235,16 @@ void st_sensors_deallocate_trigger(struct iio_dev *indio_dev); irqreturn_t st_sensors_trigger_handler(int irq, void *p); int st_sensors_get_buffer_element(struct iio_dev *indio_dev, u8 *buf); +#else +static inline int st_sensors_allocate_trigger(struct iio_dev *indio_dev, + const struct iio_trigger_ops *trigger_ops) +{ + return 0; +} +static inline void st_sensors_deallocate_trigger(struct iio_dev *indio_dev) +{ + return; +} #endif int st_sensors_init_sensor(struct iio_dev *indio_dev);