Skip to content

Commit

Permalink
drivers: counter: stm32_rtc: fix clk disable for WBAX
Browse files Browse the repository at this point in the history
clock_control_on() was called instead of clock_control_off().

Signed-off-by: Abderrahmane Jarmouni <[email protected]>
(cherry picked from commit c09f1ec)
  • Loading branch information
ajarmouni-st authored and henrikbrixandersen committed Jun 5, 2024
1 parent 1c606f5 commit 999c9a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/counter/counter_ll_stm32_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int rtc_stm32_start(const struct device *dev)

/* Enable RTC bus clock */
if (clock_control_on(clk, (clock_control_subsys_t) &cfg->pclken[0]) != 0) {
LOG_ERR("clock op failed\n");
LOG_ERR("RTC clock enabling failed\n");
return -EIO;
}
#else
Expand All @@ -212,9 +212,9 @@ static int rtc_stm32_stop(const struct device *dev)
const struct device *const clk = DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE);
const struct rtc_stm32_config *cfg = dev->config;

/* Enable RTC bus clock */
if (clock_control_on(clk, (clock_control_subsys_t) &cfg->pclken[0]) != 0) {
LOG_ERR("clock op failed\n");
/* Disable RTC bus clock */
if (clock_control_off(clk, (clock_control_subsys_t) &cfg->pclken[0]) != 0) {
LOG_ERR("RTC clock disabling failed\n");
return -EIO;
}
#else
Expand Down

0 comments on commit 999c9a3

Please sign in to comment.