From: Patrick Delaunay Date: Fri, 3 Jul 2020 15:45:07 +0000 (+0200) Subject: board: update test on misc_read result in board_late_init X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=4b64265bb472fba6c820eb81074221c4bd485ba2;p=u-boot.git board: update test on misc_read result in board_late_init Update management of misc_read, which now return length of data after the commit 8729b1ae2cbd ("misc: Update read() and write() methods to return bytes xfered") Fixes: 8b8b3d6b55b9 ("stm32mp1: board: add environment variable for board id and board rev") Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 158a7d6aaa..1d274c3157 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -686,7 +686,7 @@ int board_late_init(void) if (!ret) ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD), &otp, sizeof(otp)); - if (!ret && otp) { + if (ret > 0 && otp) { snprintf(buf, sizeof(buf), "0x%04x", otp >> 16); env_set("board_id", buf);