[PATCH] smbios: only look for a SYSINFO udevice if SYSINFO support is enabled

Quentin Schulz foss+uboot at 0leil.net
Mon Jun 10 18:13:46 CEST 2024


From: Quentin Schulz <quentin.schulz at cherry.de>

If SYSINFO support isn't enabled, it's a given that uclass_first_device
for UCLASS_SYSINFO will not find anything, therefore let's skip the test
entirely.

This allows to get rid of the following debug message that may be
confusing:

Cannot find uclass for id 118: please add the UCLASS_DRIVER() declaration for this UCLASS_... id

Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
---
 lib/smbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/smbios.c b/lib/smbios.c
index b190b010f30..a822acd48e9 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -571,7 +571,7 @@ ulong write_smbios_table(ulong addr)
 	int i;
 
 	ctx.node = ofnode_null();
-	if (IS_ENABLED(CONFIG_OF_CONTROL)) {
+	if (IS_ENABLED(CONFIG_OF_CONTROL) && CONFIG_IS_ENABLED(SYSINFO)) {
 		uclass_first_device(UCLASS_SYSINFO, &ctx.dev);
 		if (ctx.dev)
 			parent_node = dev_read_subnode(ctx.dev, "smbios");

---
base-commit: 4f836fb324ba500ecabdba4146c3ca9e1600cdf5
change-id: 20240610-smbios-sysinfo-dca17e76e11d

Best regards,
-- 
Quentin Schulz <quentin.schulz at cherry.de>



More information about the U-Boot mailing list