1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-22 10:31:56 +02:00

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2022-10-20 18:22:51 -06:00
committed by Tom Rini
parent cbd71fad6d
commit b190deb895
4 changed files with 23 additions and 8 deletions

View File

@@ -339,6 +339,15 @@ int bootflow_scan_next(struct bootflow_iter *iter, struct bootflow *bflow)
} while (1);
}
void bootflow_init(struct bootflow *bflow, struct udevice *bootdev,
struct udevice *meth)
{
memset(bflow, '\0', sizeof(*bflow));
bflow->dev = bootdev;
bflow->method = meth;
bflow->state = BOOTFLOWST_BASE;
}
void bootflow_free(struct bootflow *bflow)
{
free(bflow->name);