diff mbox series

[2/3] lib: smbios: Let detect the system via sysinfo

Message ID 4e7e75bae7104bfca3964f7a442cac9f084a1f5b.1714138688.git.michal.simek@amd.com
State Accepted
Delegated to: Ilias Apalodimas
Headers show
Series lib: smbios: Extend driver with using sysinfo driver | expand

Commit Message

Michal Simek April 26, 2024, 1:38 p.m. UTC
Currently code looks like that it sysinfo drivers are supported but
actually none checking that system is detected. That's why call
sysinfo_detect() to make sure that priv->detected in sysinfo uclass is
setup hence information from driver can be passed to smbios.

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

 lib/smbios.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Simon Glass June 10, 2024, 3:03 p.m. UTC | #1
On Fri, 26 Apr 2024 at 07:38, Michal Simek <michal.simek@amd.com> wrote:
>
> Currently code looks like that it sysinfo drivers are supported but
> actually none checking that system is detected. That's why call
> sysinfo_detect() to make sure that priv->detected in sysinfo uclass is
> setup hence information from driver can be passed to smbios.
>
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---
>
>  lib/smbios.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/lib/smbios.c b/lib/smbios.c
index b190b010f30f..3c1b3cf47e72 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -573,8 +573,14 @@  ulong write_smbios_table(ulong addr)
 	ctx.node = ofnode_null();
 	if (IS_ENABLED(CONFIG_OF_CONTROL)) {
 		uclass_first_device(UCLASS_SYSINFO, &ctx.dev);
-		if (ctx.dev)
+		if (ctx.dev) {
+			int ret;
+
 			parent_node = dev_read_subnode(ctx.dev, "smbios");
+			ret = sysinfo_detect(ctx.dev);
+			if (ret)
+				return ret;
+		}
 	} else {
 		ctx.dev = NULL;
 	}