diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-09-29 17:02:46 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-11-08 08:12:26 -0500 |
commit | 5413eaba5ae093b0704b5458696922f6518adac4 (patch) | |
tree | a511d09e9151691d5dc4634a82a5d4908d8866d1 | |
parent | b1f9d790b59dc04f8813a49a92ddd8651770ffee (diff) |
rtc: pcf85063: return an error when date is invalid
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>
-rw-r--r-- | drivers/rtc/rtc-pcf85063.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c index b6d73dd881f2..63334cbeca41 100644 --- a/drivers/rtc/rtc-pcf85063.c +++ b/drivers/rtc/rtc-pcf85063.c | |||
@@ -80,13 +80,7 @@ static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
80 | pcf85063->c_polarity = (buf[PCF85063_REG_MO] & PCF85063_MO_C) ? | 80 | pcf85063->c_polarity = (buf[PCF85063_REG_MO] & PCF85063_MO_C) ? |
81 | (tm->tm_year >= 100) : (tm->tm_year < 100); | 81 | (tm->tm_year >= 100) : (tm->tm_year < 100); |
82 | 82 | ||
83 | /* the clock can give out invalid datetime, but we cannot return | 83 | return rtc_valid_tm(tm); |
84 | * -EINVAL otherwise hwclock will refuse to set the time on bootup. | ||
85 | */ | ||
86 | if (rtc_valid_tm(tm) < 0) | ||
87 | dev_err(&client->dev, "retrieved date/time is not valid.\n"); | ||
88 | |||
89 | return 0; | ||
90 | } | 84 | } |
91 | 85 | ||
92 | static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm) | 86 | static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm) |