stm32mp1: update sysconf_init on misc_read result
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 2 Aug 2019 11:08:06 +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 in sysconf_init, 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/stm32mp1.c

index d994d38..95e6078 100644 (file)
@@ -487,7 +487,7 @@ static void sysconf_init(void)
                }
 
                ret = misc_read(dev, STM32_BSEC_SHADOW(18), &otp, 4);
-               if (!ret)
+               if (ret > 0)
                        otp = otp & BIT(13);
 
                /* get VDD = vdd-supply */