diff mbox series

[RFC,WIP,v1,3/7] wandboard: reorder board_fit_config_name_match

Message ID 20200114061314.148491-4-hs@denx.de
State New
Headers show
Series wandboard: add imx6dl rev d1 support | expand

Commit Message

Heiko Schocher Jan. 14, 2020, 6:13 a.m. UTC
handle different board revisions in one if path.

Without this change if "imx6dl-wandboard-revb1" is passed
before "imx6dl-wandboard-revd1" to this function,
"imx6dl-wandboard-revb1" is detected as the correct version,
on revd1 boards, as "imx6dl-wandboard-revb1" is not dependend
on is_revd1().

Signed-off-by: Heiko Schocher <hs at denx.de>
---

 board/wandboard/wandboard.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index 05f36b7f5d5..4cb9bf6f8c2 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -489,19 +489,22 @@  int board_fit_config_name_match(const char *name)
 			return 0;
 	}
 
-	if (is_mx6dq() && is_revd1()) {
-		if (!strcmp(name, "imx6q-wandboard-revd1"))
-			return 0;
-	} else if ((is_mx6dl() || is_mx6solo()) && is_revd1()) {
-		if (!strcmp(name, "imx6dl-wandboard-revd1"))
-			return 0;
-	}
-	if (is_mx6dq()) {
-		if (!strcmp(name, "imx6q-wandboard-revb1"))
-			return 0;
-	} else if (is_mx6dl() || is_mx6solo()) {
-		if (!strcmp(name, "imx6dl-wandboard-revb1"))
-			return 0;
+	if (is_revd1()) {
+		if (is_mx6dq()) {
+			if (!strcmp(name, "imx6q-wandboard-revd1"))
+				return 0;
+		} else if (is_mx6dl() || is_mx6solo()) {
+			if (!strcmp(name, "imx6dl-wandboard-revd1"))
+				return 0;
+		}
+	} else {
+		if (is_mx6dq()) {
+			if (!strcmp(name, "imx6q-wandboard-revb1"))
+				return 0;
+		} else if (is_mx6dl() || is_mx6solo()) {
+			if (!strcmp(name, "imx6dl-wandboard-revb1"))
+				return 0;
+		}
 	}
 
 	return -EINVAL;