]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: Fix return value in dev_read_alias_seq()
authorSimon Glass <sjg@chromium.org>
Thu, 17 Dec 2020 04:20:12 +0000 (21:20 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 19 Dec 2020 03:32:21 +0000 (20:32 -0700)
This should return 0 on success but currently does not. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/core/read.c

index 076125824cab007ba858ccb9508bfb5ea48b77fa..fc74d64814f8af62655084d56eef1448a9ce263c 100644 (file)
@@ -281,8 +281,10 @@ int dev_read_alias_seq(const struct udevice *dev, int *devnump)
 
        if (ofnode_is_np(node)) {
                ret = of_alias_get_id(ofnode_to_np(node), uc_name);
-               if (ret >= 0)
+               if (ret >= 0) {
                        *devnump = ret;
+                       ret = 0;
+               }
        } else {
 #if CONFIG_IS_ENABLED(OF_CONTROL)
                ret = fdtdec_get_alias_seq(gd->fdt_blob, uc_name,