aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2021-04-20 10:50:56 -0400
committerTom Rini <trini@konsulko.com>2021-05-04 07:57:18 -0400
commit4d65c6bcd71ab2a03a5b7fff0ecf22d068597b25 (patch)
treec316ea01cce93a65522e5a08bef090cb01a16e74 /common
parenteed0a7a3e6087d038fccea18676e285d9807b644 (diff)
downloadu-boot-4d65c6bcd71ab2a03a5b7fff0ecf22d068597b25.zip
u-boot-4d65c6bcd71ab2a03a5b7fff0ecf22d068597b25.tar.gz
u-boot-4d65c6bcd71ab2a03a5b7fff0ecf22d068597b25.tar.bz2
sysinfo: Require that sysinfo_detect be called before other methods
This has the uclass enforce calling detect() before other methods. This allows drivers to cache information in detect() and perform (cheaper) retrieval in the other accessors. This also modifies the only instance where this sequencing was not followed. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_fit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 4288f57..caddf51 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -110,6 +110,10 @@ static int spl_fit_get_image_name(const struct spl_fit_info *ctx,
* no string in the property for this index. Check if the
* sysinfo-level code can supply one.
*/
+ rc = sysinfo_detect(sysinfo);
+ if (rc)
+ return rc;
+
rc = sysinfo_get_fit_loadable(sysinfo, index - i - 1, type,
&str);
if (rc && rc != -ENOENT)