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>
diff --git a/boot/bootmeth-uclass.c b/boot/bootmeth-uclass.c
index 2d7652e..25552dd 100644
--- a/boot/bootmeth-uclass.c
+++ b/boot/bootmeth-uclass.c
@@ -77,10 +77,7 @@
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);
}