Skip to content

Commit 4618a27

Browse files
jhedbergkartben
authored andcommitted
drivers: serial: silabs: Fix build for efm32wg_stk3800/efm32wg990f256
The gecko_uart.c driver supports both `silabs,gecko_uart` and `silabs,gecko_usart` compat strings, however `PM_DEVICE_DT_INST_DEFINE()` was missing when defining `uart` type instances. The efm32wg_stk3800/efm32wg990f256 platform enables by default one `gecko_uart` DT node and no `gecko_usart` nodes. This results in the following build warning/error: uart_gecko.c:673:12: warning: 'uart_gecko_pm_action' defined but not used Add the missing call to `PM_DEVICE_DT_INST_DEFINE()`. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 20360ce commit 4618a27

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/serial/uart_gecko.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ static DEVICE_API(uart, uart_gecko_driver_api) = {
835835
VALIDATE_GECKO_UART_RTS_CTS_PIN_LOCATIONS(idx); \
836836
\
837837
GECKO_UART_IRQ_HANDLER_DECL(idx); \
838+
PM_DEVICE_DT_INST_DEFINE(idx, uart_gecko_pm_action); \
838839
\
839840
static struct uart_config uart_cfg_##idx = { \
840841
.baudrate = DT_INST_PROP(idx, current_speed), \
@@ -861,12 +862,10 @@ static DEVICE_API(uart, uart_gecko_driver_api) = {
861862
.uart_cfg = &uart_cfg_##idx, \
862863
}; \
863864
\
864-
DEVICE_DT_INST_DEFINE(idx, uart_gecko_init, \
865-
NULL, &uart_gecko_data_##idx, \
866-
&uart_gecko_cfg_##idx, PRE_KERNEL_1, \
867-
CONFIG_SERIAL_INIT_PRIORITY, \
868-
&uart_gecko_driver_api); \
869-
\
865+
DEVICE_DT_INST_DEFINE(idx, uart_gecko_init, PM_DEVICE_DT_INST_GET(idx), \
866+
&uart_gecko_data_##idx, &uart_gecko_cfg_##idx, \
867+
PRE_KERNEL_1, CONFIG_SERIAL_INIT_PRIORITY, \
868+
&uart_gecko_driver_api); \
870869
\
871870
GECKO_UART_IRQ_HANDLER(idx)
872871

0 commit comments

Comments
 (0)