linux_dsm_epyc7002/include/linux/iio
Arnd Bergmann 6d745ee8b5 iio: stm32: fix adc/trigger link error
The ADC driver can trigger on either the timer or the lptim
trigger, but it only uses a Kconfig 'select' statement
to ensure that the first of the two is present. When the lptim
trigger is enabled as a loadable module, and the adc driver
is built-in, we now get a link error:

drivers/iio/adc/stm32-adc.o: In function `stm32_adc_get_trig_extsel':
stm32-adc.c:(.text+0x4e0): undefined reference to `is_stm32_lptim_trigger'

We could use a second 'select' statement and always have both
trigger drivers enabled when the adc driver is, but it seems that
the lptimer trigger was intentionally left optional, so it seems
better to keep it that way.

This adds a hack to use 'IS_REACHABLE()' rather than 'IS_ENABLED()',
which avoids the link error, but instead leads to the lptimer trigger
not being used in the broken configuration. I've added a runtime
warning for this case to help users figure out what they did wrong
if this should ever be done by accident.

Fixes: f0b638a7f6 ("iio: adc: stm32: add support for lptimer triggers")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-12-02 11:21:31 +00:00
..
accel
adc iio: ad_sigma_delta: Implement a dedicated reset function 2017-09-24 16:58:21 +01:00
common iio: st_sensors: split open-drain parameters for irq1 and irq2 2017-10-10 20:38:39 +01:00
dac License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
frequency
gyro
imu
magnetometer License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timer iio: stm32: fix adc/trigger link error 2017-12-02 11:21:31 +00:00
buffer_impl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
buffer-dma.h
buffer-dmaengine.h
buffer.h iio:buffer.h - split into buffer.h and buffer_impl.h 2017-01-10 19:54:55 +00:00
configfs.h
consumer.h iio: inkern: api for manipulating ext_info of iio channels 2017-06-03 19:29:26 +09:00
driver.h
events.h
iio.h iio: Drop duplicate forward declaration 2017-10-14 18:29:20 +01:00
kfifo_buf.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
machine.h
sw_device.h iio: make function argument and some structures const 2017-10-19 16:15:24 +02:00
sw_trigger.h iio: make function argument and some structures const 2017-10-19 16:15:24 +02:00
sysfs.h
trigger_consumer.h
trigger.h Round one of new device support, features and cleanup for IIO in the 4.15 cycle. 2017-09-25 12:56:37 +02:00
triggered_buffer.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
triggered_event.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
types.h