Skip to content

Commit 9b090a9

Browse files
arndbjic23
authored andcommitted
iio: st_magn: always define ST_MAGN_TRIGGER_SET_STATE
When CONFIG_IIO_TRIGGER is enabled but CONFIG_IIO_BUFFER is not, we get a build error in the st_magn driver: drivers/iio/magnetometer/st_magn_core.c:573:23: error: 'ST_MAGN_TRIGGER_SET_STATE' undeclared here (not in a function) .set_trigger_state = ST_MAGN_TRIGGER_SET_STATE, ^~~~~~~~~~~~~~~~~~~~~~~~~ Apparently, this ST_MAGN_TRIGGER_SET_STATE macro was meant to be set to NULL when the definition is not available because st_magn_buffer.c is not compiled, but the alternative definition was not included in the original patch. This adds it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 74f5683 ("iio: st_magn: Add irq trigger handling") Acked-by: Denis Ciocca <denis.ciocca@st.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 1bef2c1 commit 9b090a9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/iio/magnetometer/st_magn.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static inline int st_magn_allocate_ring(struct iio_dev *indio_dev)
4444
static inline void st_magn_deallocate_ring(struct iio_dev *indio_dev)
4545
{
4646
}
47+
#define ST_MAGN_TRIGGER_SET_STATE NULL
4748
#endif /* CONFIG_IIO_BUFFER */
4849

4950
#endif /* ST_MAGN_H */

0 commit comments

Comments
 (0)