projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b26eb88
)
dm: rtc: Correct rtc_read32() return value
author
Simon Glass
<sjg@chromium.org>
Sun, 18 Oct 2015 21:55:31 +0000
(15:55 -0600)
committer
Simon Glass
<sjg@chromium.org>
Wed, 21 Oct 2015 13:46:50 +0000
(07:46 -0600)
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>
drivers/rtc/rtc-uclass.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/rtc-uclass.c
b/drivers/rtc/rtc-uclass.c
index fe74c69f97ec3a3ebb9164a0e585b482b6d66628..300e9b30ec9576b6c193caaf18217b81b4dbae12 100644
(file)
--- a/
drivers/rtc/rtc-uclass.c
+++ b/
drivers/rtc/rtc-uclass.c
@@
-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);
}