From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] bootchooser: export bootchooser_entry_boot function
Date: Thu, 14 Nov 2024 15:20:16 +0100 [thread overview]
Message-ID: <20241114142016.80497-1-a.fatoum@pengutronix.de> (raw)
When migrating a board to use bootchooser instead of a custom boot
handler, it can be useful to add an intermediate boot target that
decides whether to use bootchooser or the old boot target it replaces.
Make expressing this straight-forward in C by exporting
bootchooser_entry_boot(), so it can be called from the intermediate boot
target's struct bootentry::boot function.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/bootchooser.c | 2 +-
include/bootchooser.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/common/bootchooser.c b/common/bootchooser.c
index 65291c5e59d3..5df7ff764db8 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -868,7 +868,7 @@ int bootchooser_boot(struct bootchooser *bc)
return ret;
}
-static int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun)
+int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun)
{
struct bootchooser *bc;
int ret;
diff --git a/include/bootchooser.h b/include/bootchooser.h
index 2cfd5b126ab9..31989163b236 100644
--- a/include/bootchooser.h
+++ b/include/bootchooser.h
@@ -31,6 +31,8 @@ struct bootchooser_target *bootchooser_target_first(struct bootchooser *bootchoo
struct bootchooser_target *bootchooser_target_next(struct bootchooser *bootchooser,
struct bootchooser_target *cur);
+int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun);
+
#define bootchooser_for_each_target(bootchooser, target) \
for (target = bootchooser_target_first(bootchooser); target; \
target = bootchooser_target_next(bootchooser, target))
--
2.39.5
reply other threads:[~2024-11-14 14:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20241114142016.80497-1-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