diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/boot.c | 6 | ||||
-rw-r--r-- | common/bootchooser.c | 11 |
2 files changed, 9 insertions, 8 deletions
diff --git a/common/boot.c b/common/boot.c index 3280ac4f54..cef3d5e514 100644 --- a/common/boot.c +++ b/common/boot.c @@ -289,12 +289,6 @@ int bootentry_create_from_name(struct bootentries *bootentries, found += ret; } - if (IS_ENABLED(CONFIG_BOOTCHOOSER) && !strcmp(name, "bootchooser")) { - ret = bootchooser_create_bootentry(bootentries); - if (ret > 0) - found += ret; - } - if (!found) { char *path; diff --git a/common/bootchooser.c b/common/bootchooser.c index 9c110f267e..f2174a1348 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); |