From patchwork Tue Jan 14 06:13:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239584 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:10 +0100 Subject: [RFC WIP PATCH v1 3/7] wandboard: reorder board_fit_config_name_match In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-4-hs@denx.de> 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 --- board/wandboard/wandboard.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) 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;