From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 7/8] power: reset: reboot-mode: fix link error without globalvar
Date: Fri, 17 May 2024 15:26:55 +0200 [thread overview]
Message-ID: <20240517132656.3151273-8-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240517132656.3151273-1-a.fatoum@pengutronix.de>
The reboot_mode_add_globalvar initcall would run even without
CONFIG_GLOBALVAR if it didn't fail at link time, because it references
the global_device. Fix this by only registering the initcall if global
variable support is enabled.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/power/reset/reboot-mode.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot-mode.c
index 7f940a2d8843..b52e7ec0dc27 100644
--- a/drivers/power/reset/reboot-mode.c
+++ b/drivers/power/reset/reboot-mode.c
@@ -71,7 +71,7 @@ static int of_reboot_mode_fixup(struct device_node *root, void *ctx)
return 0;
}
-static int reboot_mode_add_globalvar(void)
+static __maybe_unused int reboot_mode_add_globalvar(void)
{
struct reboot_mode_driver *reboot = __boot_mode;
@@ -83,8 +83,9 @@ static int reboot_mode_add_globalvar(void)
return reboot_mode_add_param(&global_device, "system.reboot_mode.", reboot);
}
+#ifdef CONFIG_GLOBALVAR
late_initcall(reboot_mode_add_globalvar);
-
+#endif
static void reboot_mode_print(struct reboot_mode_driver *reboot,
const char *prefix, const u32 *arr)
--
2.39.2
next prev parent reply other threads:[~2024-05-17 13:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 13:26 [PATCH 0/8] kconfig: cut down on duplication with merged defconfigs Ahmad Fatoum
2024-05-17 13:26 ` [PATCH 1/8] test: move common config fragments into common/boards/configs Ahmad Fatoum
2024-05-17 13:26 ` [PATCH 2/8] kconfig: merge_config.sh: sync with Linux v6.9 Ahmad Fatoum
2024-05-17 13:26 ` [PATCH 3/8] kbuild: add support for merged defconfigs Ahmad Fatoum
2024-05-17 13:26 ` [PATCH 4/8] MIPS: make use of " Ahmad Fatoum
2024-05-20 10:23 ` [PATCH] fixup! " Ahmad Fatoum
2024-05-17 13:26 ` [PATCH 5/8] sandbox: stdio: fix ctrlc link error when CONFIG_CONSOLE_NONE=y Ahmad Fatoum
2024-05-17 13:26 ` [PATCH 6/8] net: fix build with CONFIG_SHELL_NONE Ahmad Fatoum
2024-05-17 13:26 ` Ahmad Fatoum [this message]
2024-05-17 13:26 ` [PATCH 8/8] sandbox: add headless_defconfig Ahmad Fatoum
2024-05-21 6:20 ` [PATCH 0/8] kconfig: cut down on duplication with merged defconfigs Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240517132656.3151273-8-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox