diff options
author | Simon Glass <sjg@chromium.org> | 2018-11-06 15:21:39 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-11-20 19:14:22 -0700 |
commit | 8729b1ae2cbda83059a55811614a2b0dbfdf7e53 (patch) | |
tree | 65fa9cfd636340f9c9fc97bb3fa76de36c5bf1e2 /arch/arm/mach-stm32mp | |
parent | 96794a3eaee9bf368efe475f0a040d0e08b09dc9 (diff) | |
download | u-boot-8729b1ae2cbda83059a55811614a2b0dbfdf7e53.tar.gz u-boot-8729b1ae2cbda83059a55811614a2b0dbfdf7e53.tar.xz u-boot-8729b1ae2cbda83059a55811614a2b0dbfdf7e53.zip |
misc: Update read() and write() methods to return bytes xfered
At present these functions return 0 on success. For some devices we want
to know how many bytes were transferred. It seems useful to adjust the API
to be more like the POSIX read() and write() functions.
Update these two methods, a test and all users.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp')
-rw-r--r-- | arch/arm/mach-stm32mp/cpu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index 0e01f8e613..b8933587ad 100644 --- a/arch/arm/mach-stm32mp/cpu.c +++ b/arch/arm/mach-stm32mp/cpu.c @@ -306,7 +306,7 @@ static int setup_mac_address(void) ret = misc_read(dev, BSEC_OTP_MAC * 4 + STM32_BSEC_OTP_OFFSET, otp, sizeof(otp)); - if (ret) + if (ret < 0) return ret; for (i = 0; i < 6; i++) @@ -344,7 +344,7 @@ static int setup_serial_number(void) ret = misc_read(dev, BSEC_OTP_SERIAL * 4 + STM32_BSEC_OTP_OFFSET, otp, sizeof(otp)); - if (ret) + if (ret < 0) return ret; sprintf(serial_string, "%08x%08x%08x", otp[0], otp[1], otp[2]); |