From b1b85fcf4871116dbb08980eae044b6e240fd1e9 Mon Sep 17 00:00:00 2001 From: Mathieu Choplain Date: Thu, 22 Aug 2024 16:50:37 +0200 Subject: [PATCH] drivers: intc: stm32: remove STM32_EXTI_LINE_NONE macro The EXTI driver API defined in exti_stm32.h is reserved for exclusive usage by the STM32 GPIO driver, which doesn't use this macro. Since there is no usecase for it anyways, it can be removed for future-proofing. The STM32 UART driver is an unintended user of this definition, however. Replace it with a private #define which is more appropriate anyways. Signed-off-by: Mathieu Choplain --- drivers/serial/uart_stm32.c | 10 +++++++--- .../zephyr/drivers/interrupt_controller/exti_stm32.h | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index c74239e0439..e0232c550e6 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -67,6 +66,11 @@ LOG_MODULE_REGISTER(uart_stm32, CONFIG_UART_LOG_LEVEL); #define HAS_DRIVER_ENABLE 0 #endif +#ifdef CONFIG_PM +/* Placeholder value when wakeup-line DT property is not defined */ +#define STM32_WAKEUP_LINE_NONE 0xFFFFFFFF +#endif + #if HAS_LPUART #ifdef USART_PRESC_PRESCALER uint32_t lpuartdiv_calc(const uint64_t clock_rate, const uint16_t presc_idx, @@ -2064,7 +2068,7 @@ static int uart_stm32_registers_configure(const struct device *dev) #endif LL_USART_EnableInStopMode(usart); - if (config->wakeup_line != STM32_EXTI_LINE_NONE) { + if (config->wakeup_line != STM32_WAKEUP_LINE_NONE) { /* Prepare the WAKEUP with the expected EXTI line */ LL_EXTI_EnableIT_0_31(BIT(config->wakeup_line)); } @@ -2290,7 +2294,7 @@ static void uart_stm32_irq_config_func_##index(const struct device *dev) \ .wakeup_source = DT_INST_PROP(index, wakeup_source), \ .wakeup_line = COND_CODE_1(DT_INST_NODE_HAS_PROP(index, wakeup_line), \ (DT_INST_PROP(index, wakeup_line)), \ - (STM32_EXTI_LINE_NONE)), + (STM32_WAKEUP_LINE_NONE)), #else #define STM32_UART_PM_WAKEUP(index) /* Not used */ #endif diff --git a/include/zephyr/drivers/interrupt_controller/exti_stm32.h b/include/zephyr/drivers/interrupt_controller/exti_stm32.h index 0bd808f921c..cd4b31146d6 100644 --- a/include/zephyr/drivers/interrupt_controller/exti_stm32.h +++ b/include/zephyr/drivers/interrupt_controller/exti_stm32.h @@ -23,8 +23,6 @@ #include -#define STM32_EXTI_LINE_NONE 0xFFFFFFFFU - /** * @brief enable EXTI interrupt for specific line *