提交 4b64265b 编写于 作者: P Patrick Delaunay 提交者: Patrice Chotard

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 8729b1ae ("misc: Update read() and write()
methods to return bytes xfered")

Fixes: 8b8b3d6b ("stm32mp1: board: add environment variable for board id and board rev")
Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: NPatrice Chotard <patrice.chotard@st.com>
上级 1e3d0605
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册