]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
dm: core: lists_bind_fdt: Replace found variable
authorMarkus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Tue, 27 Jan 2026 11:03:36 +0000 (12:03 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 28 Jan 2026 15:20:59 +0000 (09:20 -0600)
'found' is only used at the end of the function to print a debug
message. No need to maintain a variable if we can just return 0
immediately when a driver was bound successfully.

Reviewed-by: Simon Glass <simon.glass@canonical.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
drivers/core/lists.c

index 52ba6c7bfa007b660b854de62c97ad3c1761f1a5..9d1ca38212ee7f53b8894f964f096611c8ec20a5 100644 (file)
@@ -204,7 +204,6 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
        const struct udevice_id *id;
        struct driver *entry;
        struct udevice *dev;
-       bool found = false;
        const char *name, *compat_list, *compat;
        int compat_length, i;
        int ret = 0;
@@ -275,14 +274,14 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
                                ret);
                        return log_msg_ret("bind", ret);
                } else {
-                       found = true;
                        if (devp)
                                *devp = dev;
+                       return 0;
                }
                break;
        }
 
-       if (!found && ret != -ENODEV)
+       if (ret != -ENODEV)
                log_debug("No match for node '%s'\n", name);
 
        return 0;