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 <h...@denx.de> --- 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; -- 2.24.1