summaryrefslogtreecommitdiffstats
path: root/common/bootchooser.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-05 16:28:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-06 10:48:59 +0200
commit18c05a168124a027aa481ab79d4527f1767939e6 (patch)
tree06c5642d88e2131ca95104da2a5d71a904774d52 /common/bootchooser.c
parentb79ce1382f201bf2e098bafe618a81a4a83e7d1e (diff)
downloadbarebox-18c05a168124a027aa481ab79d4527f1767939e6.tar.gz
bootchooser: register as bootentry provider
Instead of using a global function called by bootentry_create_from_name(), register the bootchooser as bootentry provider. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/bootchooser.c')
-rw-r--r--common/bootchooser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/bootchooser.c b/common/bootchooser.c
index 9c110f2..f2174a1 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -863,10 +863,14 @@ static void bootchooser_release(struct bootentry *entry)
*
* Return: The number of entries added to the list
*/
-int bootchooser_create_bootentry(struct bootentries *entries)
+static int bootchooser_add_entry(struct bootentries *entries, const char *name)
{
- struct bootchooser *bc = bootchooser_get();
+ struct bootchooser *bc;
+
+ if (strcmp(name, "bootchooser"))
+ return 0;
+ bc = bootchooser_get();
if (IS_ERR(bc))
return PTR_ERR(bc);
@@ -904,6 +908,9 @@ static int bootchooser_init(void)
reset_attempts_names, ARRAY_SIZE(reset_attempts_names));
globalvar_add_simple_bitmask("bootchooser.reset_priorities", &reset_priorities,
reset_priorities_names, ARRAY_SIZE(reset_priorities_names));
+
+ bootentry_register_provider(bootchooser_add_entry);
+
return 0;
}
device_initcall(bootchooser_init);