[PATCH 04/10] smbios: ignore the non-existence of platform sysinfo detect

Raymond Mao raymond.mao at linaro.org
Fri Aug 16 17:46:47 CEST 2024


During writing SMBIOS table, implementation of sysinfo detect
function for a specific platform is not mandatory.
Thus we should not return an error when platform sysinfo
detect function does not exist.

Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
---
 lib/smbios.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/smbios.c b/lib/smbios.c
index 8e481365165..2f1759d419e 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -825,10 +825,9 @@ ulong write_smbios_table(ulong addr)
 	if (CONFIG_IS_ENABLED(SYSINFO)) {
 		uclass_first_device(UCLASS_SYSINFO, &ctx.dev);
 		if (ctx.dev) {
-			int ret;
+			int ret = sysinfo_detect(ctx.dev);
 
 			parent_node = dev_read_subnode(ctx.dev, "smbios");
-			ret = sysinfo_detect(ctx.dev);
 
 			/*
 			 * ignore the error since many boards don't implement
-- 
2.25.1



More information about the U-Boot mailing list