summaryrefslogtreecommitdiffstats
path: root/common/bootchooser.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/bootchooser.c')
-rw-r--r--common/bootchooser.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/common/bootchooser.c b/common/bootchooser.c
index f2174a1348..455f290fa2 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");