]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp1: board update command stboard on misc_read result
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 2 Aug 2019 11:08:07 +0000 (13:08 +0200)
committerPatrice Chotard <patrice.chotard@st.com>
Tue, 27 Aug 2019 09:19:23 +0000 (11:19 +0200)
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")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
board/st/stm32mp1/cmd_stboard.c

index f781c364cf6bfabb9311d613e555e1ad938f31b9..04352ae8ed28b5b35e7cfb54e8ccab7d3e5a7dd1 100644 (file)
@@ -60,7 +60,7 @@ static int do_stboard(cmd_tbl_t *cmdtp, int flag, int argc,
        ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD),
                        &otp, sizeof(otp));
 
-       if (ret) {
+       if (ret < 0) {
                puts("OTP read error");
                return CMD_RET_FAILURE;
        }