mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 11:24:42 +00:00
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>
This commit is contained in:
parent
2662b54d70
commit
eccb25cd59
3 changed files with 9 additions and 5 deletions
|
@ -36,7 +36,6 @@ enum {
|
||||||
|
|
||||||
int bootdev_add_bootflow(struct bootflow *bflow)
|
int bootdev_add_bootflow(struct bootflow *bflow)
|
||||||
{
|
{
|
||||||
struct bootdev_uc_plat *ucp = dev_get_uclass_plat(bflow->dev);
|
|
||||||
struct bootstd_priv *std;
|
struct bootstd_priv *std;
|
||||||
struct bootflow *new;
|
struct bootflow *new;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -52,7 +51,11 @@ int bootdev_add_bootflow(struct bootflow *bflow)
|
||||||
memcpy(new, bflow, sizeof(*bflow));
|
memcpy(new, bflow, sizeof(*bflow));
|
||||||
|
|
||||||
list_add_tail(&new->glob_node, &std->glob_head);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,7 +307,8 @@ void bootflow_free(struct bootflow *bflow)
|
||||||
|
|
||||||
void bootflow_remove(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);
|
list_del(&bflow->glob_node);
|
||||||
|
|
||||||
bootflow_free(bflow);
|
bootflow_free(bflow);
|
||||||
|
|
|
@ -69,8 +69,8 @@ static void show_bootflow(int index, struct bootflow *bflow, bool errors)
|
||||||
{
|
{
|
||||||
printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index,
|
printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index,
|
||||||
bflow->method->name, bootflow_state_get_name(bflow->state),
|
bflow->method->name, bootflow_state_get_name(bflow->state),
|
||||||
dev_get_uclass_name(dev_get_parent(bflow->dev)), bflow->part,
|
bflow->dev ? dev_get_uclass_name(dev_get_parent(bflow->dev)) :
|
||||||
bflow->name, bflow->fname);
|
"(none)", bflow->part, bflow->name, bflow->fname);
|
||||||
if (errors)
|
if (errors)
|
||||||
report_bootflow_err(bflow, bflow->err);
|
report_bootflow_err(bflow, bflow->err);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue