summaryrefslogtreecommitdiff
path: root/boot/bootstd-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-11-15 16:19:09 -0700
committerTom Rini <[email protected]>2025-01-15 08:48:42 -0600
commit92182257733b446f3074a8a9b0a7eafea6ea8c1c (patch)
tree19ddbe4e6a45f3aafed8a2bf2515a12aff25788a /boot/bootstd-uclass.c
parent47903aacc520c96bafae1225484e5df740a233e6 (diff)
bootstd: Move bootflow-clearing to bootstd
This relates to more than just the bootdev, since there is a global list of bootflows. Move the function to the bootstd file and rename it. Signed-off-by: Simon Glass <[email protected]> Acked-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'boot/bootstd-uclass.c')
-rw-r--r--boot/bootstd-uclass.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/boot/bootstd-uclass.c b/boot/bootstd-uclass.c
index bf6e49ad97a..596d3e5e41d 100644
--- a/boot/bootstd-uclass.c
+++ b/boot/bootstd-uclass.c
@@ -86,6 +86,21 @@ int bootstd_add_bootflow(struct bootflow *bflow)
return 0;
}
+int bootstd_clear_bootflows_for_bootdev(struct udevice *dev)
+{
+ struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev);
+
+ while (!list_empty(&ucp->bootflow_head)) {
+ struct bootflow *bflow;
+
+ bflow = list_first_entry(&ucp->bootflow_head, struct bootflow,
+ bm_node);
+ bootflow_remove(bflow);
+ }
+
+ return 0;
+}
+
static int bootstd_remove(struct udevice *dev)
{
struct bootstd_priv *priv = dev_get_priv(dev);