]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: ti: am57xx: Fix detection of board version
authorLokesh Vutla <lokeshvutla@ti.com>
Sun, 16 Jul 2017 14:29:18 +0000 (19:59 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 26 Jul 2017 15:26:49 +0000 (11:26 -0400)
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>
board/ti/am57xx/board.c

index bf8c8e1a678fb2dc35431d2d9a86e5dde7301b31..6e248d6b1a5410248f5ebc6c44054d986fd29657 100644 (file)
 
 #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")