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/bootflow.c b/boot/bootflow.c
index 5d94a27..f9ad409 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -339,6 +339,15 @@
} 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);