summaryrefslogtreecommitdiff
path: root/include/bootstd.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-11-15 16:19:12 -0700
committerTom Rini <trini@konsulko.com>2025-01-15 08:48:42 -0600
commit49867e804543f64ca216653c3905d8022c31fc84 (patch)
tree8588bae07829c92ab693f0c1198ff4ccdc5afe39 /include/bootstd.h
parent6a3eb84b18333eb4beb7e660fa9ae8ccff07b0c4 (diff)
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 <sjg@chromium.org>
Diffstat (limited to 'include/bootstd.h')
-rw-r--r--include/bootstd.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/bootstd.h b/include/bootstd.h
index 8aff536e3cb..3398e48e88b 100644
--- a/include/bootstd.h
+++ b/include/bootstd.h
@@ -9,6 +9,7 @@
#ifndef __bootstd_h
#define __bootstd_h
+#include <alist.h>
#include <dm/ofnode_decl.h>
#include <linux/list.h>
#include <linux/types.h>
@@ -30,7 +31,8 @@ struct udevice;
* terminated)
* @cur_bootdev: Currently selected bootdev (for commands)
* @cur_bootflow: Currently selected bootflow (for commands)
- * @glob_head: Head for the global list of all bootflows across all bootdevs
+ * @bootflows: (struct bootflow) Global list of all bootflows across all
+ * bootdevs
* @bootmeth_count: Number of bootmeth devices in @bootmeth_order
* @bootmeth_order: List of bootmeth devices to use, in order, NULL-terminated
* @vbe_bootmeth: Currently selected VBE bootmeth, NULL if none
@@ -44,7 +46,7 @@ struct bootstd_priv {
const char **env_order;
struct udevice *cur_bootdev;
struct bootflow *cur_bootflow;
- struct list_head glob_head;
+ struct alist bootflows;
int bootmeth_count;
struct udevice **bootmeth_order;
struct udevice *vbe_bootmeth;
@@ -135,7 +137,7 @@ int bootstd_prog_boot(void);
* since this function takes over ownership of these. This functions makes
* a copy of @bflow itself (without allocating its fields again), so the
* caller must dispose of the memory used by the @bflow pointer itself
- * Return: 0 if OK, -ENOMEM if out of memory
+ * Return: element number in the list, if OK, -ENOMEM if out of memory
*/
int bootstd_add_bootflow(struct bootflow *bflow);