diff options
author | Simon Glass <sjg@chromium.org> | 2023-01-17 10:47:15 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-01-23 18:11:39 -0500 |
commit | 6a6638f0939dca65c7d1cd0d766957d3d3adc519 (patch) | |
tree | 7eb2cae66d5f768a0e57322600f3bc604016df3b /boot/bootstd-uclass.c | |
parent | 3e96ed44e8c5b63bd0cef1e263e7991ac16c21e3 (diff) |
bootstd: Remove special-case code for boot_targets
Rather than implement this as its own case in build_order(), process the
boot_targets environment variable in the bootstd_get_bootdev_order()
function. This allows build_order() to be simplified.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/bootstd-uclass.c')
-rw-r--r-- | boot/bootstd-uclass.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/boot/bootstd-uclass.c b/boot/bootstd-uclass.c index 7887acdc11..81555d341e 100644 --- a/boot/bootstd-uclass.c +++ b/boot/bootstd-uclass.c @@ -10,6 +10,7 @@ #include <bootflow.h> #include <bootstd.h> #include <dm.h> +#include <env.h> #include <log.h> #include <malloc.h> #include <dm/device-internal.h> @@ -72,9 +73,23 @@ static int bootstd_remove(struct udevice *dev) return 0; } -const char *const *const bootstd_get_bootdev_order(struct udevice *dev) +const char *const *const bootstd_get_bootdev_order(struct udevice *dev, + bool *okp) { struct bootstd_priv *std = dev_get_priv(dev); + const char *targets = env_get("boot_targets"); + + *okp = true; + log_debug("- targets %s %p\n", targets, std->bootdev_order); + if (targets && *targets) { + str_free_list(std->env_order); + std->env_order = str_to_list(targets); + if (!std->env_order) { + *okp = false; + return NULL; + } + return std->env_order; + } return std->bootdev_order; } |