summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-04-01 22:32:48 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-02 06:35:40 +0000
commite077b9d9a24182eeb6156c4eeba78b3fd67be50d (patch)
tree504611615e521c241518434c68c2af769a08f970
parentd855d4cb0a047000681997aead727e74561aaef0 (diff)
downloadchrome-ec-e077b9d9a24182eeb6156c4eeba78b3fd67be50d.tar.gz
zephyr: drivers: system: fix SYS_INIT
As per https://docs.zephyrproject.org/latest/reference/drivers/index.html#initialization-levels "symbolic expressions are not permitted" Change replaces the symbolic expressions to a constant one along with a verification step to ensure that the correct ordering takes place. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I6556abe9bcfd03aa259436d2ec37dd8ffca06b06 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2801099 Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--zephyr/drivers/cros_system/cros_system_npcx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/zephyr/drivers/cros_system/cros_system_npcx.c b/zephyr/drivers/cros_system/cros_system_npcx.c
index 67c2d799ac..5b1c70fe1e 100644
--- a/zephyr/drivers/cros_system/cros_system_npcx.c
+++ b/zephyr/drivers/cros_system/cros_system_npcx.c
@@ -195,4 +195,7 @@ static int jtag_init(const struct device *dev)
return 0;
}
-SYS_INIT(jtag_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT + 1);
+#if CONFIG_KERNEL_INIT_PRIORITY_DEFAULT >= 41
+#error "jtag_init must be called after default kernel init"
+#endif
+SYS_INIT(jtag_init, PRE_KERNEL_1, 41);