mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 23:51:33 +00:00
rockchip: misc: fix misc_read() return check
misc_read() is documented to return the number of bytes read or a negative error value. The Rockchip drivers currently do not implement this correctly and instead return zero on success or a negative error value. In preparation for fixing the drivers, fix the condition here to only error on negative values. Suggested-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
parent
6fa83833b0
commit
999680c4ed
1 changed files with 1 additions and 1 deletions
|
@ -83,7 +83,7 @@ int rockchip_cpuid_from_efuse(const u32 cpuid_offset,
|
|||
|
||||
/* read the cpu_id range from the efuses */
|
||||
ret = misc_read(dev, cpuid_offset, cpuid, cpuid_length);
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
debug("%s: reading cpuid from the efuses failed\n",
|
||||
__func__);
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue