drivers: stm32: check clock_control_on return value
Check clock_control_on return value now that it is checking appropriate
bus is used in the request.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
diff --git a/drivers/spi/spi_ll_stm32.c b/drivers/spi/spi_ll_stm32.c
index 3d70d43..103d530 100644
--- a/drivers/spi/spi_ll_stm32.c
+++ b/drivers/spi/spi_ll_stm32.c
@@ -465,8 +465,11 @@
__ASSERT_NO_MSG(device_get_binding(STM32_CLOCK_CONTROL_NAME));
- clock_control_on(device_get_binding(STM32_CLOCK_CONTROL_NAME),
- (clock_control_subsys_t) &cfg->pclken);
+ if (clock_control_on(device_get_binding(STM32_CLOCK_CONTROL_NAME),
+ (clock_control_subsys_t) &cfg->pclken) != 0) {
+ LOG_ERR("Could not enable SPI clock");
+ return -EIO;
+ }
#ifdef CONFIG_SPI_STM32_INTERRUPT
cfg->irq_config(dev);