drivers: serial: stm32: store IRQ config function in a single place

When CONFIG_PM=y, the IRQ function also needs to be stored, something
the "generic" uart_device_config cannot support. This uses the config
irq_config_func field to store the function in all situations, thus
removing unnecessary logic and finally dropping uart_device_config.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-01-25 16:21:36 +01:00 committed by Anas Nashif
commit e101cc78e9
2 changed files with 9 additions and 19 deletions

View file

@ -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
};