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

@ -440,10 +440,7 @@ int bootdev_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,
if (!ops->get_bootflow)
return -ENOSYS;
memset(bflow, '\0', sizeof(*bflow));
bflow->dev = dev;
bflow->method = iter->method;
bflow->state = BOOTFLOWST_BASE;
bootflow_init(bflow, dev, iter->method);
return ops->get_bootflow(dev, iter, bflow);
}