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>
This commit is contained in:
parent
b3db3a3bda
commit
dadd657d89
2 changed files with 2 additions and 2 deletions
|
@ -1017,7 +1017,7 @@ static int eusart_init(const struct device *dev)
|
|||
/* The peripheral and gpio clock are already enabled from soc and gpio driver */
|
||||
/* Enable EUSART clock */
|
||||
err = clock_control_on(config->clock_dev, (clock_control_subsys_t)&config->clock_cfg);
|
||||
if (err < 0) {
|
||||
if (err < 0 && err != -EALREADY) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -1019,7 +1019,7 @@ static int uart_silabs_init(const struct device *dev)
|
|||
/* The peripheral and gpio clock are already enabled from soc and gpio driver */
|
||||
/* Enable USART clock */
|
||||
err = clock_control_on(config->clock_dev, (clock_control_subsys_t)&config->clock_cfg);
|
||||
if (err < 0) {
|
||||
if (err < 0 && err != -EALREADY) {
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue