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

@@ -77,10 +77,7 @@ int bootmeth_get_bootflow(struct udevice *dev, struct bootflow *bflow)
if (!ops->read_bootflow)
return -ENOSYS;
memset(bflow, '\0', sizeof(*bflow));
bflow->dev = NULL;
bflow->method = dev;
bflow->state = BOOTFLOWST_BASE;
bootflow_init(bflow, NULL, dev);
return ops->read_bootflow(dev, bflow);
}