Skip to content

Commit 5878070

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi_silabs_usart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ static int spi_silabs_usart_init(const struct device *dev)
342342
/* Enable USART clock */
343343
#ifdef CONFIG_CLOCK_CONTROL
344344
err = clock_control_on(config->clock_dev, (clock_control_subsys_t)&config->clock_cfg);
345-
if (err < 0) {
345+
if (err < 0 && err != -EALREADY) {
346346
return err;
347347
}
348348
#else

0 commit comments

Comments
 (0)