mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
board: update test on misc_read result in board_late_init
Update management of misc_read, which now return length of data after the commit8729b1ae2c
("misc: Update read() and write() methods to return bytes xfered") Fixes:8b8b3d6b55
("stm32mp1: board: add environment variable for board id and board rev") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
parent
1e3d060501
commit
4b64265bb4
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue