]> git.baikalelectronics.ru Git - uboot.git/commit
rockchip: misc: fix misc_read() return check
authorJohn Keeping <john@metanate.com>
Mon, 27 Mar 2023 11:01:08 +0000 (12:01 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 21 Apr 2023 07:16:01 +0000 (15:16 +0800)
commit1cb4bb8ca73c0c412f66736d17537b51f6d101e0
tree0c80483ad6aa829d8ad4d58a889fd736cf9d09c1
parent45a6e693c35656558bbbe25a8cf480b3af3fecad
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>
arch/arm/mach-rockchip/misc.c