From 6a3eb84b18333eb4beb7e660fa9ae8ccff07b0c4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:11 -0700 Subject: bootstd: Drop the bootdev-specific list of bootflows This list is only used by two functions, which can be updated to iterate through the global list. Take this approach, which allows the bootdev list to be dropped. Overall this makes the code slightly more complicated, but will allow moving the bootflow list into an alist Signed-off-by: Simon Glass --- boot/bootstd-uclass.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'boot/bootstd-uclass.c') diff --git a/boot/bootstd-uclass.c b/boot/bootstd-uclass.c index b2f80808c85..91e90bdf43c 100644 --- a/boot/bootstd-uclass.c +++ b/boot/bootstd-uclass.c @@ -77,25 +77,22 @@ int bootstd_add_bootflow(struct bootflow *bflow) memcpy(new, bflow, sizeof(*bflow)); list_add_tail(&new->glob_node, &std->glob_head); - if (bflow->dev) { - struct bootdev_uc_plat *ucp = dev_get_uclass_plat(bflow->dev); - - list_add_tail(&new->bm_node, &ucp->bootflow_head); - } return 0; } int bootstd_clear_bootflows_for_bootdev(struct udevice *dev) { - struct bootdev_uc_plat *ucp = dev_get_uclass_plat(dev); + struct bootstd_priv *std = bootstd_try_priv(); - while (!list_empty(&ucp->bootflow_head)) { + if (std) { struct bootflow *bflow; + struct list_head *pos; - bflow = list_first_entry(&ucp->bootflow_head, struct bootflow, - bm_node); - bootflow_remove(bflow); + list_for_each(pos, &std->glob_head) { + bflow = list_entry(pos, struct bootflow, glob_node); + bootflow_remove(bflow); + } } return 0; -- cgit v1.2.3