diff options
author | Simon Glass <sjg@chromium.org> | 2022-07-30 15:52:23 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-08-12 08:17:11 -0400 |
commit | eccb25cd5922edebc15f135923aa2b4bbd26527d (patch) | |
tree | 4ffd44ff0c951a104d180a3239b06984efa3a486 /boot | |
parent | 2662b54d70fc04f070f0e4a9742d4b3197c9f3ea (diff) | |
download | u-boot-eccb25cd5922edebc15f135923aa2b4bbd26527d.zip u-boot-eccb25cd5922edebc15f135923aa2b4bbd26527d.tar.gz u-boot-eccb25cd5922edebc15f135923aa2b4bbd26527d.tar.bz2 |
bootstd: Allow the bootdev to be optional in bootflows
With global bootmeths we want to scan without a bootdev. Update the logic
to allow this.
Change the bootflow command to show the bootdev only when valid.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/bootdev-uclass.c | 7 | ||||
-rw-r--r-- | boot/bootflow.c | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 5683006..13ac69e 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -36,7 +36,6 @@ enum { int bootdev_add_bootflow(struct bootflow *bflow) { - struct bootdev_uc_plat *ucp = dev_get_uclass_plat(bflow->dev); struct bootstd_priv *std; struct bootflow *new; int ret; @@ -52,7 +51,11 @@ int bootdev_add_bootflow(struct bootflow *bflow) memcpy(new, bflow, sizeof(*bflow)); list_add_tail(&new->glob_node, &std->glob_head); - list_add_tail(&new->bm_node, &ucp->bootflow_head); + if (bflow->dev) { + struct bootdev_uc_plat *ucp = dev_get_uclass_plat(bflow->dev); + + list_add_tail(&new->bm_node, &ucp->bootflow_head); + } return 0; } diff --git a/boot/bootflow.c b/boot/bootflow.c index 24ba3c3..37bccb8 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -307,7 +307,8 @@ void bootflow_free(struct bootflow *bflow) void bootflow_remove(struct bootflow *bflow) { - list_del(&bflow->bm_node); + if (bflow->dev) + list_del(&bflow->bm_node); list_del(&bflow->glob_node); bootflow_free(bflow); |