]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: pcf85063: return an error when date is invalid
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Tue, 29 Sep 2015 21:02:46 +0000 (23:02 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 3 Oct 2015 15:22:28 +0000 (17:22 +0200)
Return an error when the date is invalid as the policy should be
implemented there.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-pcf85063.c

index b6d73dd881f248bce67976754fb5f932477d5686..63334cbeca41d8233b55e674e120ec4bd895a45a 100644 (file)
@@ -80,13 +80,7 @@ static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm)
        pcf85063->c_polarity = (buf[PCF85063_REG_MO] & PCF85063_MO_C) ?
                (tm->tm_year >= 100) : (tm->tm_year < 100);
 
-       /* the clock can give out invalid datetime, but we cannot return
-        * -EINVAL otherwise hwclock will refuse to set the time on bootup.
-        */
-       if (rtc_valid_tm(tm) < 0)
-               dev_err(&client->dev, "retrieved date/time is not valid.\n");
-
-       return 0;
+       return rtc_valid_tm(tm);
 }
 
 static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm)