]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
smbios: Correct error handling when writing tables
authorSimon Glass <sjg@chromium.org>
Sun, 23 Jun 2024 20:30:33 +0000 (14:30 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 4 Jul 2024 15:25:21 +0000 (09:25 -0600)
Since write_smbios_table() returns an address, we cannot use it to
return and error number. Also, failing on sysinfo_detect() breaks
existing boards, e.g. chromebook_link

Correct this by logging and swallowing the error.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: a5a57562856 ("lib: smbios: Detect system properties via...")
lib/smbios.c

index fb6eaf1d5ca1a544295c0c1c756cb387c7584d1c..4126466e34a84438bf65032e1378f43baf4aab2b 100644 (file)
@@ -5,6 +5,8 @@
  * Adapted from coreboot src/arch/x86/smbios.c
  */
 
+#define LOG_CATEGORY   LOGC_BOARD
+
 #include <dm.h>
 #include <env.h>
 #include <linux/stringify.h>
@@ -596,8 +598,12 @@ ulong write_smbios_table(ulong addr)
 
                        parent_node = dev_read_subnode(ctx.dev, "smbios");
                        ret = sysinfo_detect(ctx.dev);
-                       if (ret)
-                               return ret;
+
+                       /*
+                        * ignore the error since many boards don't implement
+                        * this and we can still use the info in the devicetree
+                        */
+                       ret = log_msg_ret("sys", ret);
                }
        } else {
                ctx.dev = NULL;