From 0e8e7a01897837794553555e94abf93d74cccebb Mon Sep 17 00:00:00 2001 From: Brett Witherspoon Date: Sat, 16 Sep 2023 15:20:11 -0400 Subject: [PATCH] drivers: rtc: stm32: fix cell index of source clock The DT_INST_CLOCKS_CELL macro takes as the first argument the device instance and not the cell index. This change correctly gets the second index of the first device as intended. Signed-off-by: Brett Witherspoon --- drivers/rtc/rtc_ll_stm32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc_ll_stm32.c b/drivers/rtc/rtc_ll_stm32.c index 66c277aa43f..cb7c85ad3a1 100644 --- a/drivers/rtc/rtc_ll_stm32.c +++ b/drivers/rtc/rtc_ll_stm32.c @@ -168,11 +168,11 @@ static int rtc_stm32_init(const struct device *dev) static const struct stm32_pclken rtc_clk[] = STM32_DT_INST_CLOCKS(0); static const struct rtc_stm32_config rtc_config = { -#if DT_INST_CLOCKS_CELL(1, bus) == STM32_SRC_LSI +#if DT_INST_CLOCKS_CELL_BY_IDX(0, 1, bus) == STM32_SRC_LSI /* prescaler values for LSI @ 32 KHz */ .async_prescaler = 0x7F, .sync_prescaler = 0x00F9, -#else /* DT_INST_CLOCKS_CELL(1, bus) == STM32_SRC_LSE */ +#else /* DT_INST_CLOCKS_CELL_BY_IDX(0, 1, bus) == STM32_SRC_LSE */ /* prescaler values for LSE @ 32768 Hz */ .async_prescaler = 0x7F, .sync_prescaler = 0x00FF,