diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index dace455434a..2a15cbea4be 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1620,11 +1620,11 @@ static int uart_stm32_init(const struct device *dev) } #endif /* !USART_ISR_REACK */ -#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API) - config->uconf.irq_config_func(dev); -#elif defined(CONFIG_PM) +#if defined(CONFIG_PM) || \ + defined(CONFIG_UART_INTERRUPT_DRIVEN) || \ + defined(CONFIG_UART_ASYNC_API) config->irq_config_func(dev); -#endif /* defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API) */ +#endif /* CONFIG_PM || CONFIG_UART_INTERRUPT_DRIVEN || CONFIG_UART_ASYNC_API */ #ifdef CONFIG_UART_ASYNC_API return uart_stm32_async_init(dev); @@ -1681,17 +1681,12 @@ static void uart_stm32_irq_config_func_##index(const struct device *dev) \ #define STM32_UART_IRQ_HANDLER(index) /* Not used */ #endif -#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API) +#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API) || \ + defined(CONFIG_PM) #define STM32_UART_IRQ_HANDLER_FUNC(index) \ .irq_config_func = uart_stm32_irq_config_func_##index, -#define STM32_UART_POLL_IRQ_HANDLER_FUNC(index) /* Not used */ -#elif defined(CONFIG_PM) -#define STM32_UART_IRQ_HANDLER_FUNC(index) /* Not used */ -#define STM32_UART_POLL_IRQ_HANDLER_FUNC(index) \ - .irq_config_func = uart_stm32_irq_config_func_##index, #else #define STM32_UART_IRQ_HANDLER_FUNC(index) /* Not used */ -#define STM32_UART_POLL_IRQ_HANDLER_FUNC(index) /* Not used */ #endif #ifdef CONFIG_UART_ASYNC_API @@ -1713,9 +1708,6 @@ PINCTRL_DT_INST_DEFINE(index); \ \ static const struct uart_stm32_config uart_stm32_cfg_##index = { \ .usart = (USART_TypeDef *)DT_INST_REG_ADDR(index), \ - .uconf = { \ - STM32_UART_IRQ_HANDLER_FUNC(index) \ - }, \ .pclken = { .bus = DT_INST_CLOCKS_CELL(index, bus), \ .enr = DT_INST_CLOCKS_CELL(index, bits) \ }, \ @@ -1723,7 +1715,7 @@ static const struct uart_stm32_config uart_stm32_cfg_##index = { \ .parity = DT_INST_ENUM_IDX_OR(index, parity, UART_CFG_PARITY_NONE), \ .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(index), \ .single_wire = DT_INST_PROP_OR(index, single_wire, false), \ - STM32_UART_POLL_IRQ_HANDLER_FUNC(index) \ + STM32_UART_IRQ_HANDLER_FUNC(index) \ }; \ \ static struct uart_stm32_data uart_stm32_data_##index = { \ diff --git a/drivers/serial/uart_stm32.h b/drivers/serial/uart_stm32.h index eaeea38bfb0..c8b45c5a8d3 100644 --- a/drivers/serial/uart_stm32.h +++ b/drivers/serial/uart_stm32.h @@ -20,7 +20,6 @@ struct uart_stm32_config { /* USART instance */ USART_TypeDef *usart; - struct uart_device_config uconf; /* clock subsystem driving this peripheral */ struct stm32_pclken pclken; /* initial hardware flow control, 1 for RTS/CTS */ @@ -30,9 +29,8 @@ struct uart_stm32_config { /* switch to enable single wire / half duplex feature */ bool single_wire; const struct pinctrl_dev_config *pcfg; -#if defined(CONFIG_PM) \ - && !defined(CONFIG_UART_INTERRUPT_DRIVEN) \ - && !defined(CONFIG_UART_ASYNC_API) +#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API) || \ + defined(CONFIG_PM) uart_irq_config_func_t irq_config_func; #endif };