summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-05 16:29:36 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-06 10:49:04 +0200
commit9653eefe40c7945a85b8c17657f17dc9e2ed3776 (patch)
tree6ab3676dae9ad66d86198a749e3420bd652f4df0
parent18c05a168124a027aa481ab79d4527f1767939e6 (diff)
downloadbarebox-9653eefe40c7945a85b8c17657f17dc9e2ed3776.tar.gz
bootchooser: export bootchooser_boot
Some boards that boot directly from C code do already know that they want to boot from bootchooser and nothing else. For these it's easiest to call bootchooser_boot directly, so export this function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/bootchooser.c19
-rw-r--r--include/bootchooser.h2
2 files changed, 14 insertions, 7 deletions
diff --git a/common/bootchooser.c b/common/bootchooser.c
index f2174a1..455f290 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -827,15 +827,10 @@ out:
return ret;
}
-static int bootchooser_boot(struct bootentry *entry, int verbose, int dryrun)
+int bootchooser_boot(struct bootchooser *bc)
{
- struct bootchooser *bc = container_of(entry, struct bootchooser,
- entry);
int ret, tryagain;
- bc->verbose = verbose;
- bc->dryrun = dryrun;
-
do {
ret = bootchooser_boot_one(bc, &tryagain);
@@ -846,6 +841,16 @@ static int bootchooser_boot(struct bootentry *entry, int verbose, int dryrun)
return ret;
}
+static int bootchooser_entry_boot(struct bootentry *entry, int verbose, int dryrun)
+{
+ struct bootchooser *bc = container_of(entry, struct bootchooser,
+ entry);
+ bc->verbose = verbose;
+ bc->dryrun = dryrun;
+
+ return bootchooser_boot(bc);
+}
+
static void bootchooser_release(struct bootentry *entry)
{
struct bootchooser *bc = container_of(entry, struct bootchooser,
@@ -874,7 +879,7 @@ static int bootchooser_add_entry(struct bootentries *entries, const char *name)
if (IS_ERR(bc))
return PTR_ERR(bc);
- bc->entry.boot = bootchooser_boot;
+ bc->entry.boot = bootchooser_entry_boot;
bc->entry.release = bootchooser_release;
bc->entry.title = xstrdup("bootchooser");
bc->entry.description = xstrdup("bootchooser");
diff --git a/include/bootchooser.h b/include/bootchooser.h
index 246258e..7822c01 100644
--- a/include/bootchooser.h
+++ b/include/bootchooser.h
@@ -13,6 +13,8 @@ int bootchooser_put(struct bootchooser *bootchooser);
void bootchooser_info(struct bootchooser *bootchooser);
+int bootchooser_boot(struct bootchooser *bc);
+
struct bootchooser_target *bootchooser_get_last_chosen(struct bootchooser *bootchooser);
const char *bootchooser_target_name(struct bootchooser_target *target);
struct bootchooser_target *bootchooser_target_by_name(struct bootchooser *bootchooser,