diff options
author | Lokesh Vutla <lokeshvutla@ti.com> | 2017-07-16 14:29:18 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-07-26 15:26:49 (GMT) |
commit | 7087922477a08bd1c06bcb5a280ff5e81065ec30 (patch) | |
tree | 62dc0e74225a86f2429b7cae731bd7f7e79c64e8 /board/ti/am57xx/board.c | |
parent | 9cb1c49afb84d102fc6915bdb106069826ad3c92 (diff) | |
download | u-boot-fsl-qoriq-7087922477a08bd1c06bcb5a280ff5e81065ec30.tar.xz |
board: ti: am57xx: Fix detection of board version
board_is*("rev", board_ti_get_rev()) uses strncmp() for
revison detection and assumes it is success if return value
is <= 0. This will fail in case of multiple versions, as
revb will be true for board_is_*revb() and board_is_*reva().
Fix it by looking for exact match of the string.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board/ti/am57xx/board.c')
-rw-r--r-- | board/ti/am57xx/board.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index bf8c8e1..6e248d6 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -36,11 +36,11 @@ #define board_is_x15() board_ti_is("BBRDX15_") #define board_is_x15_revb1() (board_ti_is("BBRDX15_") && \ - (strncmp("B.10", board_ti_get_rev(), 3) <= 0)) + !strncmp("B.10", board_ti_get_rev(), 3)) #define board_is_am572x_evm() board_ti_is("AM572PM_") #define board_is_am572x_evm_reva3() \ (board_ti_is("AM572PM_") && \ - (strncmp("A.30", board_ti_get_rev(), 3) <= 0)) + !strncmp("A.30", board_ti_get_rev(), 3)) #define board_is_am572x_idk() board_ti_is("AM572IDK") #define board_is_am571x_idk() board_ti_is("AM571IDK") |