diff --git a/drivers/counter/counter_ll_stm32_rtc.c b/drivers/counter/counter_ll_stm32_rtc.c index 3cb67009ccb..4549a79ffb3 100644 --- a/drivers/counter/counter_ll_stm32_rtc.c +++ b/drivers/counter/counter_ll_stm32_rtc.c @@ -451,15 +451,15 @@ static int rtc_stm32_init(const struct device *dev) static struct rtc_stm32_data rtc_data; #if DT_INST_NUM_CLOCKS(0) == 1 -#warning Kconfig COUNTER_RTC_STM32_CLOCK_LS* are deprecated. Please define clock source in dtsi file +#warning STM32 RTC needs a kernel source clock. Please define it in dts file static const struct stm32_pclken rtc_clk[] = { STM32_CLOCK_INFO(0, DT_DRV_INST(0)), - /* Use Kconfig to configure source clocks fields */ + /* Use Kconfig to configure source clocks fields (Deprecated) */ /* Fortunately, values are consistent across enabled series */ -#ifdef COUNTER_RTC_STM32_CLOCK_LSI - {.bus = STM32_SRC_LSI, .enr = RTC_SEL(2)} -#else +#ifdef CONFIG_COUNTER_RTC_STM32_CLOCK_LSE {.bus = STM32_SRC_LSE, .enr = RTC_SEL(1)} +#else + {.bus = STM32_SRC_LSI, .enr = RTC_SEL(2)} #endif }; #else