mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-28 15:13:31 +08:00
dm: rtc: Correct rtc_read32() return value
The current check is incorrect and will fail when any non-zero byte is read. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
b26eb88658
commit
9a4eb5977a
@ -68,7 +68,7 @@ int rtc_read32(struct udevice *dev, unsigned int reg, u32 *valuep)
|
||||
|
||||
for (i = 0; i < sizeof(value); i++) {
|
||||
ret = rtc_read8(dev, reg + i);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
value |= ret << (i << 3);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user