From b190deb8955f1043817faf84a69dd63d5a53f959 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 20 Oct 2022 18:22:51 -0600 Subject: 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 --- boot/bootflow.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'boot/bootflow.c') diff --git a/boot/bootflow.c b/boot/bootflow.c index 5d94a27ff84..f9ad4099244 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -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); -- cgit v1.2.3