aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2012-07-30 17:41:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:18 -0400
commit8e74b6edc9b7befd9f7a61b9271384eeb1eb8251 (patch)
tree14b7bc8621b1ea5ef36c70959b6e93fdba86f855 /drivers/rtc
parentaa11ec593e2c68d57728d2ebb2da265468e410c9 (diff)
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 <devendra.aaru@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Anatolij Gustschin <agust@denx.de> Cc: Andreas Dumberger <andreas.dumberger@tqs.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-r9701.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c
index e6c34c024706..2c183ebff715 100644
--- a/drivers/rtc/rtc-r9701.c
+++ b/drivers/rtc/rtc-r9701.c
@@ -147,7 +147,8 @@ static int __devinit r9701_probe(struct spi_device *spi)
147 dt.tm_mon = 0; 147 dt.tm_mon = 0;
148 dt.tm_year = 100; 148 dt.tm_year = 100;
149 149
150 if (r9701_set_datetime(&spi->dev, &dt)) { 150 if (r9701_set_datetime(&spi->dev, &dt) ||
151 r9701_get_datetime(&spi->dev, &dt)) {
151 dev_err(&spi->dev, "cannot repair RTC register\n"); 152 dev_err(&spi->dev, "cannot repair RTC register\n");
152 return -ENODEV; 153 return -ENODEV;
153 } 154 }