Skip to content

Commit dadd657

Browse files
asmellbydkalowsk
authored andcommitted
drivers: serial: silabs: Don't fail to init if clock is on
It is not an error if the clock source for the UART is already enabled. This may happen if a bootloader has used the UART and not de-initialized it before booting the application. Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
1 parent b3db3a3 commit dadd657

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/serial/uart_silabs_eusart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ static int eusart_init(const struct device *dev)
10171017
/* The peripheral and gpio clock are already enabled from soc and gpio driver */
10181018
/* Enable EUSART clock */
10191019
err = clock_control_on(config->clock_dev, (clock_control_subsys_t)&config->clock_cfg);
1020-
if (err < 0) {
1020+
if (err < 0 && err != -EALREADY) {
10211021
return err;
10221022
}
10231023

drivers/serial/uart_silabs_usart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static int uart_silabs_init(const struct device *dev)
10191019
/* The peripheral and gpio clock are already enabled from soc and gpio driver */
10201020
/* Enable USART clock */
10211021
err = clock_control_on(config->clock_dev, (clock_control_subsys_t)&config->clock_cfg);
1022-
if (err < 0) {
1022+
if (err < 0 && err != -EALREADY) {
10231023
return err;
10241024
}
10251025

0 commit comments

Comments
 (0)