From 8bd91e21c2568df273a52aeb1c5d490d45ce6703 Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Fri, 11 Oct 2024 09:27:36 +0200 Subject: [PATCH] drivers: adc: stm32: fix clock check for stm32f1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STM32F1 doesn't have synchronous/asynchronous source clock choice. The recently added clock check was failing compilation for these series. This commit removes the check for F1. (cherry picked from commit f4f1b1a365699f64dabf30aeb90a9263bb5f6d60) Original-Signed-off-by: Guillaume Gautier GitOrigin-RevId: f4f1b1a365699f64dabf30aeb90a9263bb5f6d60 Cr-Build-Id: 8733746390213692641 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8733746390213692641 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I0ea3563e75ac23627233bf1fca207f8267dadffd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5934665 Commit-Queue: Dawid Niedźwiecki Reviewed-by: Jeremy Bettis Reviewed-by: Dawid Niedźwiecki Tested-by: Dawid Niedźwiecki --- drivers/adc/adc_stm32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index 6d0765c43f0..81e44ccab2f 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -1754,15 +1754,16 @@ static const struct adc_driver_api api_stm32_driver_api = { /* Concat prefix (1st element) and DIV value (2nd element) of st,adc-prescaler */ #if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc) #define ADC_STM32_DT_PRESC(x) 0 +#define ADC_STM32_CHECK_DT_CLOCK(x) #else #define ADC_STM32_DT_PRESC(x) \ _CONCAT(ADC_STM32_CLOCK_PREFIX(x), ADC_STM32_DIV(x)) -#endif - /* Macro to check if the ADC instance clock setup is correct */ #define ADC_STM32_CHECK_DT_CLOCK(x) \ BUILD_ASSERT(IS_EQ(ADC_STM32_CLOCK(x), SYNC) || (DT_INST_NUM_CLOCKS(x) > 1), \ "ASYNC clock mode defined without ASYNC clock defined in device tree") +#endif + #if defined(CONFIG_ADC_STM32_DMA)