[PATCH v2 07/26] dm: Fix return value in dev_read_alias_seq()

Simon Glass sjg at chromium.org
Fri Dec 11 02:31:32 CET 2020


This should return 0 on success but currently does not. Fix it.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 drivers/core/read.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/core/read.c b/drivers/core/read.c
index 076125824ca..fc74d64814f 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -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,
-- 
2.29.2.576.ga3fc446d84-goog



More information about the U-Boot mailing list