From 47903aacc520c96bafae1225484e5df740a233e6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:08 -0700 Subject: bootstd: Move bootflow-adding 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 --- cmd/bootflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/bootflow.c') diff --git a/cmd/bootflow.c b/cmd/bootflow.c index f67948d7368..8962464bbf8 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -207,7 +207,7 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, bflow.err = ret; if (!ret) num_valid++; - ret = bootdev_add_bootflow(&bflow); + ret = bootstd_add_bootflow(&bflow); if (ret) { printf("Out of memory\n"); return CMD_RET_FAILURE; -- cgit v1.2.3 From 92182257733b446f3074a8a9b0a7eafea6ea8c1c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:09 -0700 Subject: 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 Acked-by: Heinrich Schuchardt --- cmd/bootflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/bootflow.c') diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 8962464bbf8..1c1146ce11e 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -197,7 +197,7 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, show_header(); } if (dev) - bootdev_clear_bootflows(dev); + bootstd_clear_bootflows_for_bootdev(dev); else bootstd_clear_glob(); for (i = 0, -- cgit v1.2.3 From 49867e804543f64ca216653c3905d8022c31fc84 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Nov 2024 16:19:12 -0700 Subject: bootstd: Move the bootflow list into an alist Use an alist for this data structure as it is somewhat simpler to manage. This means that bootstd holds a simple list of bootflow structs and can drop it at will, without chasing down lists. Signed-off-by: Simon Glass --- cmd/bootflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/bootflow.c') diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 1c1146ce11e..f88995a478f 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -208,7 +208,7 @@ static int do_bootflow_scan(struct cmd_tbl *cmdtp, int flag, int argc, if (!ret) num_valid++; ret = bootstd_add_bootflow(&bflow); - if (ret) { + if (ret < 0) { printf("Out of memory\n"); return CMD_RET_FAILURE; } -- cgit v1.2.3