summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNora Schiffer <[email protected]>2026-06-02 13:57:50 +0200
committerFabio Estevam <[email protected]>2026-06-05 12:56:32 -0300
commit0ef21dd37dc1779293a101413a7ce32bd63870bb (patch)
tree7492aca938acf40835a66d4538fef178d70c7e13 /drivers
parentfa03ee371de84b512e6f941395d4e13040eedd17 (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 'drivers')
-rw-r--r--drivers/sysinfo/sysinfo-uclass.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/sysinfo/sysinfo-uclass.c b/drivers/sysinfo/sysinfo-uclass.c
index bf0f664e8dc..d18a168614e 100644
--- a/drivers/sysinfo/sysinfo-uclass.c
+++ b/drivers/sysinfo/sysinfo-uclass.c
@@ -42,6 +42,16 @@ int sysinfo_detect(struct udevice *dev)
return ret;
}
+int sysinfo_get_and_detect(struct udevice **devp)
+{
+ int ret = sysinfo_get(devp);
+
+ if (!ret)
+ ret = sysinfo_detect(*devp);
+
+ return ret;
+}
+
int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type,
const char **strp)
{