mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
drivers/rtc/rtc-r9701.c: check that r9701_set_datetime() succeeded
When the driver detects that the clock time is invalid, it attempts to write a sane time into the hardware. We curently assume that everything is OK if those writes succeeded. But it is better to re-read the time from the hardware to ensure that the new settings got there OK. Cc: Devendra Naga <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Anatolij Gustschin <[email protected]> Cc: Andreas Dumberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
aa11ec593e
commit
8e74b6edc9
1 changed files with 2 additions and 1 deletions
|
|
@ -147,7 +147,8 @@ static int __devinit r9701_probe(struct spi_device *spi)
|
|||
dt.tm_mon = 0;
|
||||
dt.tm_year = 100;
|
||||
|
||||
if (r9701_set_datetime(&spi->dev, &dt)) {
|
||||
if (r9701_set_datetime(&spi->dev, &dt) ||
|
||||
r9701_get_datetime(&spi->dev, &dt)) {
|
||||
dev_err(&spi->dev, "cannot repair RTC register\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue