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;
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;
}
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);
{
printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index,
bflow->method->name, bootflow_state_get_name(bflow->state),
- dev_get_uclass_name(dev_get_parent(bflow->dev)), bflow->part,
- bflow->name, bflow->fname);
+ bflow->dev ? dev_get_uclass_name(dev_get_parent(bflow->dev)) :
+ "(none)", bflow->part, bflow->name, bflow->fname);
if (errors)
report_bootflow_err(bflow, bflow->err);
}