mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
bootstd: Move bootflow-adding to bootstd
This relates to more than just the bootdev, since there is a global list of bootflows. Move the function to the bootstd file and rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5907c81647
commit
47903aacc5
5 changed files with 43 additions and 41 deletions
|
@ -32,31 +32,6 @@ enum {
|
|||
BOOT_TARGETS_MAX_LEN = 100,
|
||||
};
|
||||
|
||||
int bootdev_add_bootflow(struct bootflow *bflow)
|
||||
{
|
||||
struct bootstd_priv *std;
|
||||
struct bootflow *new;
|
||||
int ret;
|
||||
|
||||
ret = bootstd_get_priv(&std);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
new = malloc(sizeof(*bflow));
|
||||
if (!new)
|
||||
return log_msg_ret("bflow", -ENOMEM);
|
||||
memcpy(new, bflow, sizeof(*bflow));
|
||||
|
||||
list_add_tail(&new->glob_node, &std->glob_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;
|
||||
}
|
||||
|
||||
int bootdev_first_bootflow(struct udevice *dev, struct bootflow **bflowp)
|
||||
{
|
||||
struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue