From eba6dc2dbb3b82b4e655de3b25c63a7e2b097e5b Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Fri, 26 Mar 2021 09:41:38 -0500 Subject: [PATCH] boards: particle_*: fix antenna initialization The GPIO drivers are initialized in the POST_KERNEL level with the default priority, so whether they're available at the time the sysinit function requires them depends on how the linker orders the init records. Since we can't set a priority relative to the default priority, hard-code the maximum priority and hope it's good enough. Signed-off-by: Peter Bigot --- boards/arm/particle_argon/board.c | 7 ++++--- boards/arm/particle_boron/board.c | 7 ++++--- boards/arm/particle_xenon/board.c | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/boards/arm/particle_argon/board.c b/boards/arm/particle_argon/board.c index a6d559cb34023a..d9a2311c49efa0 100644 --- a/boards/arm/particle_argon/board.c +++ b/boards/arm/particle_argon/board.c @@ -49,6 +49,7 @@ static int board_particle_argon_init(const struct device *dev) return 0; } -/* needs to be done after GPIO driver init */ -SYS_INIT(board_particle_argon_init, POST_KERNEL, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +/* needs to be done after GPIO driver init, which is at + * POST_KERNEL:KERNEL_INIT_PRIORITY_DEFAULT. + */ +SYS_INIT(board_particle_argon_init, POST_KERNEL, 99); diff --git a/boards/arm/particle_boron/board.c b/boards/arm/particle_boron/board.c index 0e5714a3efa555..a77c3e7d6a3231 100644 --- a/boards/arm/particle_boron/board.c +++ b/boards/arm/particle_boron/board.c @@ -56,6 +56,7 @@ static int board_particle_boron_init(const struct device *dev) return 0; } -/* needs to be done after GPIO driver init */ -SYS_INIT(board_particle_boron_init, POST_KERNEL, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +/* needs to be done after GPIO driver init, which is at + * POST_KERNEL:KERNEL_INIT_PRIORITY_DEFAULT. + */ +SYS_INIT(board_particle_boron_init, POST_KERNEL, 99); diff --git a/boards/arm/particle_xenon/board.c b/boards/arm/particle_xenon/board.c index dc10fdcc08ced8..9844941294796c 100644 --- a/boards/arm/particle_xenon/board.c +++ b/boards/arm/particle_xenon/board.c @@ -49,6 +49,7 @@ static int board_particle_xenon_init(const struct device *dev) return 0; } -/* needs to be done after GPIO driver init */ -SYS_INIT(board_particle_xenon_init, POST_KERNEL, - CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +/* needs to be done after GPIO driver init, which is at + * POST_KERNEL:KERNEL_INIT_PRIORITY_DEFAULT. + */ +SYS_INIT(board_particle_xenon_init, POST_KERNEL, 99);