drivers: counter: Properly deprecate Kconfig symbols in STM32 RTC driver

Now that both RTC source clock Kconfig symbols are disabled by default,
we invert the ifdef so that in the absence of configuration we still
fall in the LSI configuration.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This commit is contained in:
Guillaume Gautier 2023-01-04 16:24:23 +01:00 committed by Carles Cufí
commit 3e6c9c40aa

View file

@ -451,15 +451,15 @@ static int rtc_stm32_init(const struct device *dev)
static struct rtc_stm32_data rtc_data; static struct rtc_stm32_data rtc_data;
#if DT_INST_NUM_CLOCKS(0) == 1 #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[] = { static const struct stm32_pclken rtc_clk[] = {
STM32_CLOCK_INFO(0, DT_DRV_INST(0)), 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 */ /* Fortunately, values are consistent across enabled series */
#ifdef COUNTER_RTC_STM32_CLOCK_LSI #ifdef CONFIG_COUNTER_RTC_STM32_CLOCK_LSE
{.bus = STM32_SRC_LSI, .enr = RTC_SEL(2)}
#else
{.bus = STM32_SRC_LSE, .enr = RTC_SEL(1)} {.bus = STM32_SRC_LSE, .enr = RTC_SEL(1)}
#else
{.bus = STM32_SRC_LSI, .enr = RTC_SEL(2)}
#endif #endif
}; };
#else #else