]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
smbios: only look for a SYSINFO udevice if SYSINFO support is enabled
authorQuentin Schulz <quentin.schulz@cherry.de>
Mon, 10 Jun 2024 16:13:46 +0000 (18:13 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 18 Jun 2024 16:41:15 +0000 (10:41 -0600)
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@cherry.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/smbios.c

index b190b010f30f31a615b49528615a602b70a1a3b4..a822acd48e9b1f68ce7d68009484eca0847c8df2 100644 (file)
@@ -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");