summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-11-15 16:19:10 -0700
committerTom Rini <[email protected]>2025-01-15 08:48:42 -0600
commit529f92677defa4788ef0d43229caa5771be041a0 (patch)
treead70e5e257d278cdf78e72469f42bbcfdf4de7e5 /include
parent92182257733b446f3074a8a9b0a7eafea6ea8c1c (diff)
bootstd: Add a function to get bootstd only if available
Provide a function which is safe to call in the 'unbind' path, which returns the bootstd priv data if available. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/bootstd.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/bootstd.h b/include/bootstd.h
index 4220ece785d..4535d91e2ad 100644
--- a/include/bootstd.h
+++ b/include/bootstd.h
@@ -90,6 +90,23 @@ const char *const *const bootstd_get_prefixes(struct udevice *dev);
int bootstd_get_priv(struct bootstd_priv **stdp);
/**
+ * bootstd_try_priv() - Try to get the (single) state for the bootstd system
+ *
+ * The state holds a global list of all bootflows that have been found. This
+ * function returns the state if available, but takes care not to create the
+ * device (or uclass) if it doesn't exist.
+ *
+ * This function is safe to use in the 'unbind' path. It will always return NULL
+ * unless the bootstd device is probed and ready, e.g. bootstd_get_priv() has
+ * previously been called.
+ *
+ * TODO([email protected]): Consider adding a bootstd pointer to global_data
+ *
+ * Return: pointer if the device exists, else NULL
+ */
+struct bootstd_priv *bootstd_try_priv(void);
+
+/**
* bootstd_clear_glob() - Clear the global list of bootflows
*
* This removes all bootflows globally and across all bootdevs.