From e9086ca8a752bb0b22149893f67a161440855eb9 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 21 Dec 2022 15:52:53 +0100 Subject: [PATCH] [nrf fromtree] boot: zephyr: Only call sys_clock_disable when supported Only call sys_clock_disable when the system clock driver support this feature. Signed-off-by: Joakim Andersson Signed-off-by: Dominik Ermel (cherry picked from commit 6242c860864bc6a1ed45f4f1af0e57b53cf3b858) --- boot/zephyr/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c index 6bb0f590f..a50eb1855 100644 --- a/boot/zephyr/main.c +++ b/boot/zephyr/main.c @@ -207,7 +207,9 @@ static void do_boot(struct boot_rsp *rsp) rsp->br_hdr->ih_hdr_size); #endif - sys_clock_disable(); + if (IS_ENABLED(CONFIG_SYSTEM_TIMER_HAS_DISABLE_SUPPORT)) { + sys_clock_disable(); + } #ifdef CONFIG_USB_DEVICE_STACK /* Disable the USB to prevent it from firing interrupts */