diff options
| author | Nora Schiffer <[email protected]> | 2026-06-02 13:57:50 +0200 |
|---|---|---|
| committer | Fabio Estevam <[email protected]> | 2026-06-05 12:56:32 -0300 |
| commit | 0ef21dd37dc1779293a101413a7ce32bd63870bb (patch) | |
| tree | 7492aca938acf40835a66d4538fef178d70c7e13 /include | |
| parent | fa03ee371de84b512e6f941395d4e13040eedd17 (diff) | |
sysinfo: add sysinfo_get_and_detect() helper
sysinfo_detect() is commonly called after sysinfo_get(). Make the API a
bit more convenient to use by introducing a helper.
Signed-off-by: Nora Schiffer <[email protected]>
Signed-off-by: Alexander Feilke <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sysinfo.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/sysinfo.h b/include/sysinfo.h index 54eb64a204a..7ca396b2ee4 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -374,6 +374,18 @@ int sysinfo_get_data_by_index(struct udevice *dev, int id, int index, int sysinfo_get(struct udevice **devp); /** + * sysinfo_get_and_detect() - Get the sysinfo device and detect it. + * + * @devp: Pointer to structure to receive the sysinfo device. + * + * This is a convenience wrapper around sysinfo_get() followed by + * sysinfo_detect() + * + * Return: 0 if OK, -ve on error. + */ +int sysinfo_get_and_detect(struct udevice **devp); + +/** * sysinfo_get_fit_loadable - Get the name of an image to load from FIT * This function can be used to provide the image names based on runtime * detection. A classic use-case would when DTBOs are used to describe @@ -438,6 +450,11 @@ static inline int sysinfo_get(struct udevice **devp) return -ENOSYS; } +static inline int sysinfo_get_and_detect(struct udevice **devp) +{ + return -ENOSYS; +} + static inline int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, const char **strp) { |
