Skip to content

Commit aaa3002

Browse files
committed
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>
1 parent ad6c46b commit aaa3002

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/linux/iio/trigger.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#ifndef _IIO_TRIGGER_H_
1313
#define _IIO_TRIGGER_H_
1414

15+
#ifdef CONFIG_IIO_TRIGGER
1516
struct iio_subirq {
1617
bool enabled;
1718
};
@@ -117,4 +118,8 @@ irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);
117118
__printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...);
118119
void iio_trigger_free(struct iio_trigger *trig);
119120

121+
#else
122+
struct iio_trigger;
123+
struct iio_trigger_ops;
124+
#endif
120125
#endif /* _IIO_TRIGGER_H_ */

0 commit comments

Comments
 (0)