Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:triggers Protect functions in triggers.h from use when not compiled

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>
Acked-by: Denis Ciocca <denis.ciocca@st.com>

+5
+5
include/linux/iio/trigger.h
··· 12 12 #ifndef _IIO_TRIGGER_H_ 13 13 #define _IIO_TRIGGER_H_ 14 14 15 + #ifdef CONFIG_IIO_TRIGGER 15 16 struct iio_subirq { 16 17 bool enabled; 17 18 }; ··· 118 117 __printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...); 119 118 void iio_trigger_free(struct iio_trigger *trig); 120 119 120 + #else 121 + struct iio_trigger; 122 + struct iio_trigger_ops; 123 + #endif 121 124 #endif /* _IIO_TRIGGER_H_ */