diff options
48 files changed, 48 insertions, 53 deletions
diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c index 8ff9dc3fe5bf..080e3c04be43 100644 --- a/drivers/rtc/rtc-ac100.c +++ b/drivers/rtc/rtc-ac100.c | |||
@@ -387,7 +387,7 @@ static int ac100_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm) | |||
387 | rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) + | 387 | rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) + |
388 | AC100_YEAR_OFF; | 388 | AC100_YEAR_OFF; |
389 | 389 | ||
390 | return rtc_valid_tm(rtc_tm); | 390 | return 0; |
391 | } | 391 | } |
392 | 392 | ||
393 | static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) | 393 | static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm) |
diff --git a/drivers/rtc/rtc-au1xxx.c b/drivers/rtc/rtc-au1xxx.c index 2ba44ccb9c3a..7c5530c71285 100644 --- a/drivers/rtc/rtc-au1xxx.c +++ b/drivers/rtc/rtc-au1xxx.c | |||
@@ -36,7 +36,7 @@ static int au1xtoy_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
36 | 36 | ||
37 | rtc_time_to_tm(t, tm); | 37 | rtc_time_to_tm(t, tm); |
38 | 38 | ||
39 | return rtc_valid_tm(tm); | 39 | return 0; |
40 | } | 40 | } |
41 | 41 | ||
42 | static int au1xtoy_rtc_set_time(struct device *dev, struct rtc_time *tm) | 42 | static int au1xtoy_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c index 98ac8d5c7901..e8698e9870fe 100644 --- a/drivers/rtc/rtc-bq32k.c +++ b/drivers/rtc/rtc-bq32k.c | |||
@@ -110,7 +110,7 @@ static int bq32k_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
110 | tm->tm_year = bcd2bin(regs.years) + | 110 | tm->tm_year = bcd2bin(regs.years) + |
111 | ((regs.cent_hours & BQ32K_CENT) ? 100 : 0); | 111 | ((regs.cent_hours & BQ32K_CENT) ? 100 : 0); |
112 | 112 | ||
113 | return rtc_valid_tm(tm); | 113 | return 0; |
114 | } | 114 | } |
115 | 115 | ||
116 | static int bq32k_rtc_set_time(struct device *dev, struct rtc_time *tm) | 116 | static int bq32k_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-ds1216.c b/drivers/rtc/rtc-ds1216.c index 9c82b1da2d45..5f158715fb4c 100644 --- a/drivers/rtc/rtc-ds1216.c +++ b/drivers/rtc/rtc-ds1216.c | |||
@@ -99,7 +99,7 @@ static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
99 | if (tm->tm_year < 70) | 99 | if (tm->tm_year < 70) |
100 | tm->tm_year += 100; | 100 | tm->tm_year += 100; |
101 | 101 | ||
102 | return rtc_valid_tm(tm); | 102 | return 0; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm) | 105 | static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-ds1286.c b/drivers/rtc/rtc-ds1286.c index ef75c349dff9..0744916b79c5 100644 --- a/drivers/rtc/rtc-ds1286.c +++ b/drivers/rtc/rtc-ds1286.c | |||
@@ -211,7 +211,7 @@ static int ds1286_read_time(struct device *dev, struct rtc_time *tm) | |||
211 | 211 | ||
212 | tm->tm_mon--; | 212 | tm->tm_mon--; |
213 | 213 | ||
214 | return rtc_valid_tm(tm); | 214 | return 0; |
215 | } | 215 | } |
216 | 216 | ||
217 | static int ds1286_set_time(struct device *dev, struct rtc_time *tm) | 217 | static int ds1286_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c index 43bcb17c922e..2a881150d51c 100644 --- a/drivers/rtc/rtc-ds1302.c +++ b/drivers/rtc/rtc-ds1302.c | |||
@@ -98,8 +98,7 @@ static int ds1302_rtc_get_time(struct device *dev, struct rtc_time *time) | |||
98 | time->tm_mon = bcd2bin(buf[RTC_ADDR_MON]) - 1; | 98 | time->tm_mon = bcd2bin(buf[RTC_ADDR_MON]) - 1; |
99 | time->tm_year = bcd2bin(buf[RTC_ADDR_YEAR]) + 100; | 99 | time->tm_year = bcd2bin(buf[RTC_ADDR_YEAR]) + 100; |
100 | 100 | ||
101 | /* Time may not be set */ | 101 | return 0; |
102 | return rtc_valid_tm(time); | ||
103 | } | 102 | } |
104 | 103 | ||
105 | static const struct rtc_class_ops ds1302_rtc_ops = { | 104 | static const struct rtc_class_ops ds1302_rtc_ops = { |
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 3d2400a39da9..2d502fc85698 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c | |||
@@ -203,8 +203,7 @@ static int ds1305_get_time(struct device *dev, struct rtc_time *time) | |||
203 | time->tm_hour, time->tm_mday, | 203 | time->tm_hour, time->tm_mday, |
204 | time->tm_mon, time->tm_year, time->tm_wday); | 204 | time->tm_mon, time->tm_year, time->tm_wday); |
205 | 205 | ||
206 | /* Time may not be set */ | 206 | return 0; |
207 | return rtc_valid_tm(time); | ||
208 | } | 207 | } |
209 | 208 | ||
210 | static int ds1305_set_time(struct device *dev, struct rtc_time *time) | 209 | static int ds1305_set_time(struct device *dev, struct rtc_time *time) |
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 4021d478b9f3..a13e59edff53 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
@@ -437,8 +437,7 @@ static int ds1307_get_time(struct device *dev, struct rtc_time *t) | |||
437 | t->tm_hour, t->tm_mday, | 437 | t->tm_hour, t->tm_mday, |
438 | t->tm_mon, t->tm_year, t->tm_wday); | 438 | t->tm_mon, t->tm_year, t->tm_wday); |
439 | 439 | ||
440 | /* initial clock setting can be undefined */ | 440 | return 0; |
441 | return rtc_valid_tm(t); | ||
442 | } | 441 | } |
443 | 442 | ||
444 | static int ds1307_set_time(struct device *dev, struct rtc_time *t) | 443 | static int ds1307_set_time(struct device *dev, struct rtc_time *t) |
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 59d27db2fd37..5208da4cf94a 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c | |||
@@ -254,7 +254,7 @@ static int ds1343_read_time(struct device *dev, struct rtc_time *dt) | |||
254 | dt->tm_mon = bcd2bin(buf[5] & 0x1F) - 1; | 254 | dt->tm_mon = bcd2bin(buf[5] & 0x1F) - 1; |
255 | dt->tm_year = bcd2bin(buf[6]) + 100; /* year offset from 1900 */ | 255 | dt->tm_year = bcd2bin(buf[6]) + 100; /* year offset from 1900 */ |
256 | 256 | ||
257 | return rtc_valid_tm(dt); | 257 | return 0; |
258 | } | 258 | } |
259 | 259 | ||
260 | static int ds1343_set_time(struct device *dev, struct rtc_time *dt) | 260 | static int ds1343_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c index ccfc9d43eb1e..938512c676ee 100644 --- a/drivers/rtc/rtc-ds1347.c +++ b/drivers/rtc/rtc-ds1347.c | |||
@@ -66,7 +66,7 @@ static int ds1347_read_time(struct device *dev, struct rtc_time *dt) | |||
66 | dt->tm_wday = bcd2bin(buf[5]) - 1; | 66 | dt->tm_wday = bcd2bin(buf[5]) - 1; |
67 | dt->tm_year = bcd2bin(buf[6]) + 100; | 67 | dt->tm_year = bcd2bin(buf[6]) + 100; |
68 | 68 | ||
69 | return rtc_valid_tm(dt); | 69 | return 0; |
70 | } | 70 | } |
71 | 71 | ||
72 | static int ds1347_set_time(struct device *dev, struct rtc_time *dt) | 72 | static int ds1347_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c index 4d5b007d7fc6..3b095401f848 100644 --- a/drivers/rtc/rtc-ds1390.c +++ b/drivers/rtc/rtc-ds1390.c | |||
@@ -153,7 +153,7 @@ static int ds1390_read_time(struct device *dev, struct rtc_time *dt) | |||
153 | /* adjust for century bit */ | 153 | /* adjust for century bit */ |
154 | dt->tm_year = bcd2bin(chip->txrx_buf[6]) + ((chip->txrx_buf[5] & 0x80) ? 100 : 0); | 154 | dt->tm_year = bcd2bin(chip->txrx_buf[6]) + ((chip->txrx_buf[5] & 0x80) ? 100 : 0); |
155 | 155 | ||
156 | return rtc_valid_tm(dt); | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | static int ds1390_set_time(struct device *dev, struct rtc_time *dt) | 159 | static int ds1390_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index ed43b4311660..1a39829d2b40 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c | |||
@@ -306,7 +306,7 @@ ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
306 | tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); | 306 | tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year); |
307 | tm->tm_isdst = 0; /* RTC has hardcoded timezone, so don't use. */ | 307 | tm->tm_isdst = 0; /* RTC has hardcoded timezone, so don't use. */ |
308 | 308 | ||
309 | return rtc_valid_tm(tm); | 309 | return 0; |
310 | } | 310 | } |
311 | 311 | ||
312 | /** | 312 | /** |
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 52baf925a690..2d781180e968 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c | |||
@@ -112,7 +112,7 @@ static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
112 | /* year is 1900 + tm->tm_year */ | 112 | /* year is 1900 + tm->tm_year */ |
113 | tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900; | 113 | tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900; |
114 | 114 | ||
115 | return rtc_valid_tm(tm); | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static const struct rtc_class_ops ds1742_rtc_ops = { | 118 | static const struct rtc_class_ops ds1742_rtc_ops = { |
diff --git a/drivers/rtc/rtc-ds2404.c b/drivers/rtc/rtc-ds2404.c index 9a1582ed7070..b886b6a5c178 100644 --- a/drivers/rtc/rtc-ds2404.c +++ b/drivers/rtc/rtc-ds2404.c | |||
@@ -207,7 +207,7 @@ static int ds2404_read_time(struct device *dev, struct rtc_time *dt) | |||
207 | time = le32_to_cpu(time); | 207 | time = le32_to_cpu(time); |
208 | 208 | ||
209 | rtc_time_to_tm(time, dt); | 209 | rtc_time_to_tm(time, dt); |
210 | return rtc_valid_tm(dt); | 210 | return 0; |
211 | } | 211 | } |
212 | 212 | ||
213 | static int ds2404_set_mmss(struct device *dev, unsigned long secs) | 213 | static int ds2404_set_mmss(struct device *dev, unsigned long secs) |
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 0550f7ba464f..7184e5145f12 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c | |||
@@ -145,7 +145,7 @@ static int ds3232_read_time(struct device *dev, struct rtc_time *time) | |||
145 | 145 | ||
146 | time->tm_year = bcd2bin(year) + add_century; | 146 | time->tm_year = bcd2bin(year) + add_century; |
147 | 147 | ||
148 | return rtc_valid_tm(time); | 148 | return 0; |
149 | } | 149 | } |
150 | 150 | ||
151 | static int ds3232_set_time(struct device *dev, struct rtc_time *time) | 151 | static int ds3232_set_time(struct device *dev, struct rtc_time *time) |
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index 0130afd7fe88..3454e7814524 100644 --- a/drivers/rtc/rtc-efi.c +++ b/drivers/rtc/rtc-efi.c | |||
@@ -176,7 +176,7 @@ static int efi_read_time(struct device *dev, struct rtc_time *tm) | |||
176 | if (!convert_from_efi_time(&eft, tm)) | 176 | if (!convert_from_efi_time(&eft, tm)) |
177 | return -EIO; | 177 | return -EIO; |
178 | 178 | ||
179 | return rtc_valid_tm(tm); | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
182 | static int efi_set_time(struct device *dev, struct rtc_time *tm) | 182 | static int efi_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c index 576eadbba296..e1137670d4d2 100644 --- a/drivers/rtc/rtc-fm3130.c +++ b/drivers/rtc/rtc-fm3130.c | |||
@@ -136,8 +136,7 @@ static int fm3130_get_time(struct device *dev, struct rtc_time *t) | |||
136 | t->tm_hour, t->tm_mday, | 136 | t->tm_hour, t->tm_mday, |
137 | t->tm_mon, t->tm_year, t->tm_wday); | 137 | t->tm_mon, t->tm_year, t->tm_wday); |
138 | 138 | ||
139 | /* initial clock setting can be undefined */ | 139 | return 0; |
140 | return rtc_valid_tm(t); | ||
141 | } | 140 | } |
142 | 141 | ||
143 | 142 | ||
diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index 38586a024ee8..46093cd13d5e 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c | |||
@@ -149,7 +149,7 @@ static int isl12022_get_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
149 | tm->tm_sec, tm->tm_min, tm->tm_hour, | 149 | tm->tm_sec, tm->tm_min, tm->tm_hour, |
150 | tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); | 150 | tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); |
151 | 151 | ||
152 | return rtc_valid_tm(tm); | 152 | return 0; |
153 | } | 153 | } |
154 | 154 | ||
155 | static int isl12022_set_datetime(struct i2c_client *client, struct rtc_time *tm) | 155 | static int isl12022_set_datetime(struct i2c_client *client, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-lpc24xx.c b/drivers/rtc/rtc-lpc24xx.c index 59d99596fdeb..14dc7b04fae0 100644 --- a/drivers/rtc/rtc-lpc24xx.c +++ b/drivers/rtc/rtc-lpc24xx.c | |||
@@ -110,7 +110,7 @@ static int lpc24xx_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
110 | tm->tm_year = CT1_YEAR(ct1); | 110 | tm->tm_year = CT1_YEAR(ct1); |
111 | tm->tm_yday = CT2_DOY(ct2); | 111 | tm->tm_yday = CT2_DOY(ct2); |
112 | 112 | ||
113 | return rtc_valid_tm(tm); | 113 | return 0; |
114 | } | 114 | } |
115 | 115 | ||
116 | static int lpc24xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) | 116 | static int lpc24xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index c90fba3ed861..1103cdc33bfa 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -230,7 +230,7 @@ static int m41t80_get_datetime(struct i2c_client *client, | |||
230 | 230 | ||
231 | /* assume 20YY not 19YY, and ignore the Century Bit */ | 231 | /* assume 20YY not 19YY, and ignore the Century Bit */ |
232 | tm->tm_year = bcd2bin(buf[M41T80_REG_YEAR]) + 100; | 232 | tm->tm_year = bcd2bin(buf[M41T80_REG_YEAR]) + 100; |
233 | return rtc_valid_tm(tm); | 233 | return 0; |
234 | } | 234 | } |
235 | 235 | ||
236 | /* Sets the given date and time to the real time clock. */ | 236 | /* Sets the given date and time to the real time clock. */ |
diff --git a/drivers/rtc/rtc-m41t94.c b/drivers/rtc/rtc-m41t94.c index 1f0eb79e69f9..bab82b4be356 100644 --- a/drivers/rtc/rtc-m41t94.c +++ b/drivers/rtc/rtc-m41t94.c | |||
@@ -99,8 +99,7 @@ static int m41t94_read_time(struct device *dev, struct rtc_time *tm) | |||
99 | tm->tm_hour, tm->tm_mday, | 99 | tm->tm_hour, tm->tm_mday, |
100 | tm->tm_mon, tm->tm_year, tm->tm_wday); | 100 | tm->tm_mon, tm->tm_year, tm->tm_wday); |
101 | 101 | ||
102 | /* initial clock setting can be undefined */ | 102 | return 0; |
103 | return rtc_valid_tm(tm); | ||
104 | } | 103 | } |
105 | 104 | ||
106 | static const struct rtc_class_ops m41t94_rtc_ops = { | 105 | static const struct rtc_class_ops m41t94_rtc_ops = { |
diff --git a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c index 810f4ea481e4..0cf6507de3c7 100644 --- a/drivers/rtc/rtc-m48t35.c +++ b/drivers/rtc/rtc-m48t35.c | |||
@@ -84,7 +84,7 @@ static int m48t35_read_time(struct device *dev, struct rtc_time *tm) | |||
84 | tm->tm_year += 100; | 84 | tm->tm_year += 100; |
85 | 85 | ||
86 | tm->tm_mon--; | 86 | tm->tm_mon--; |
87 | return rtc_valid_tm(tm); | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
90 | static int m48t35_set_time(struct device *dev, struct rtc_time *tm) | 90 | static int m48t35_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c index d2ba7d76dbb9..216fac62c888 100644 --- a/drivers/rtc/rtc-m48t59.c +++ b/drivers/rtc/rtc-m48t59.c | |||
@@ -105,7 +105,7 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
105 | dev_dbg(dev, "RTC read time %04d-%02d-%02d %02d/%02d/%02d\n", | 105 | dev_dbg(dev, "RTC read time %04d-%02d-%02d %02d/%02d/%02d\n", |
106 | tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, | 106 | tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, |
107 | tm->tm_hour, tm->tm_min, tm->tm_sec); | 107 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
108 | return rtc_valid_tm(tm); | 108 | return 0; |
109 | } | 109 | } |
110 | 110 | ||
111 | static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm) | 111 | static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index 8d17be1e6650..a9533535c3b7 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c | |||
@@ -100,7 +100,7 @@ static int m48t86_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
100 | if (m48t86_readb(dev, M48T86_HOUR) & 0x80) | 100 | if (m48t86_readb(dev, M48T86_HOUR) & 0x80) |
101 | tm->tm_hour += 12; | 101 | tm->tm_hour += 12; |
102 | 102 | ||
103 | return rtc_valid_tm(tm); | 103 | return 0; |
104 | } | 104 | } |
105 | 105 | ||
106 | static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm) | 106 | static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c index 315d09e0f2c1..745827463367 100644 --- a/drivers/rtc/rtc-max6902.c +++ b/drivers/rtc/rtc-max6902.c | |||
@@ -85,7 +85,7 @@ static int max6902_read_time(struct device *dev, struct rtc_time *dt) | |||
85 | dt->tm_year += century; | 85 | dt->tm_year += century; |
86 | dt->tm_year -= 1900; | 86 | dt->tm_year -= 1900; |
87 | 87 | ||
88 | return rtc_valid_tm(dt); | 88 | return 0; |
89 | } | 89 | } |
90 | 90 | ||
91 | static int max6902_set_time(struct device *dev, struct rtc_time *dt) | 91 | static int max6902_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-max6916.c b/drivers/rtc/rtc-max6916.c index 623ab27b2757..7e908a490cf6 100644 --- a/drivers/rtc/rtc-max6916.c +++ b/drivers/rtc/rtc-max6916.c | |||
@@ -75,7 +75,7 @@ static int max6916_read_time(struct device *dev, struct rtc_time *dt) | |||
75 | dt->tm_wday = bcd2bin(buf[5]) - 1; | 75 | dt->tm_wday = bcd2bin(buf[5]) - 1; |
76 | dt->tm_year = bcd2bin(buf[6]) + 100; | 76 | dt->tm_year = bcd2bin(buf[6]) + 100; |
77 | 77 | ||
78 | return rtc_valid_tm(dt); | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | static int max6916_set_time(struct device *dev, struct rtc_time *dt) | 81 | static int max6916_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c index db984d4bf952..e8cee123e8aa 100644 --- a/drivers/rtc/rtc-max8997.c +++ b/drivers/rtc/rtc-max8997.c | |||
@@ -153,7 +153,7 @@ static int max8997_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
153 | 153 | ||
154 | max8997_rtc_data_to_tm(data, tm, info->rtc_24hr_mode); | 154 | max8997_rtc_data_to_tm(data, tm, info->rtc_24hr_mode); |
155 | 155 | ||
156 | return rtc_valid_tm(tm); | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | static int max8997_rtc_set_time(struct device *dev, struct rtc_time *tm) | 159 | static int max8997_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c index 30804b00985e..d8c0f9b3f87d 100644 --- a/drivers/rtc/rtc-max8998.c +++ b/drivers/rtc/rtc-max8998.c | |||
@@ -120,7 +120,7 @@ static int max8998_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
120 | 120 | ||
121 | max8998_data_to_tm(data, tm); | 121 | max8998_data_to_tm(data, tm); |
122 | 122 | ||
123 | return rtc_valid_tm(tm); | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | static int max8998_rtc_set_time(struct device *dev, struct rtc_time *tm) | 126 | static int max8998_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-mcp795.c b/drivers/rtc/rtc-mcp795.c index 77f21331ae21..79e24eadbe99 100644 --- a/drivers/rtc/rtc-mcp795.c +++ b/drivers/rtc/rtc-mcp795.c | |||
@@ -262,7 +262,7 @@ static int mcp795_read_time(struct device *dev, struct rtc_time *tim) | |||
262 | tim->tm_year + 1900, tim->tm_mon, tim->tm_mday, | 262 | tim->tm_year + 1900, tim->tm_mon, tim->tm_mday, |
263 | tim->tm_wday, tim->tm_hour, tim->tm_min, tim->tm_sec); | 263 | tim->tm_wday, tim->tm_hour, tim->tm_min, tim->tm_sec); |
264 | 264 | ||
265 | return rtc_valid_tm(tim); | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | static int mcp795_set_alarm(struct device *dev, struct rtc_wkalrm *alm) | 268 | static int mcp795_set_alarm(struct device *dev, struct rtc_wkalrm *alm) |
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c index 7334c44fa7c3..901a8d170f68 100644 --- a/drivers/rtc/rtc-mrst.c +++ b/drivers/rtc/rtc-mrst.c | |||
@@ -105,7 +105,7 @@ static int mrst_read_time(struct device *dev, struct rtc_time *time) | |||
105 | /* Adjust for the 1972/1900 */ | 105 | /* Adjust for the 1972/1900 */ |
106 | time->tm_year += 72; | 106 | time->tm_year += 72; |
107 | time->tm_mon--; | 107 | time->tm_mon--; |
108 | return rtc_valid_tm(time); | 108 | return 0; |
109 | } | 109 | } |
110 | 110 | ||
111 | static int mrst_set_time(struct device *dev, struct rtc_time *time) | 111 | static int mrst_set_time(struct device *dev, struct rtc_time *time) |
diff --git a/drivers/rtc/rtc-msm6242.c b/drivers/rtc/rtc-msm6242.c index c1c5c4e3b3b4..0c72a2e8ec67 100644 --- a/drivers/rtc/rtc-msm6242.c +++ b/drivers/rtc/rtc-msm6242.c | |||
@@ -155,7 +155,7 @@ static int msm6242_read_time(struct device *dev, struct rtc_time *tm) | |||
155 | 155 | ||
156 | msm6242_unlock(priv); | 156 | msm6242_unlock(priv); |
157 | 157 | ||
158 | return rtc_valid_tm(tm); | 158 | return 0; |
159 | } | 159 | } |
160 | 160 | ||
161 | static int msm6242_set_time(struct device *dev, struct rtc_time *tm) | 161 | static int msm6242_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-mt7622.c b/drivers/rtc/rtc-mt7622.c index d79b9ae4d237..da213278f343 100644 --- a/drivers/rtc/rtc-mt7622.c +++ b/drivers/rtc/rtc-mt7622.c | |||
@@ -232,7 +232,7 @@ static int mtk_rtc_gettime(struct device *dev, struct rtc_time *tm) | |||
232 | 232 | ||
233 | mtk_rtc_get_alarm_or_time(hw, tm, MTK_TC); | 233 | mtk_rtc_get_alarm_or_time(hw, tm, MTK_TC); |
234 | 234 | ||
235 | return rtc_valid_tm(tm); | 235 | return 0; |
236 | } | 236 | } |
237 | 237 | ||
238 | static int mtk_rtc_settime(struct device *dev, struct rtc_time *tm) | 238 | static int mtk_rtc_settime(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 79bb28617d45..944c5c0fadd0 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c | |||
@@ -94,7 +94,7 @@ static int mv_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
94 | /* hw counts from year 2000, but tm_year is relative to 1900 */ | 94 | /* hw counts from year 2000, but tm_year is relative to 1900 */ |
95 | tm->tm_year = bcd2bin(year) + 100; | 95 | tm->tm_year = bcd2bin(year) + 100; |
96 | 96 | ||
97 | return rtc_valid_tm(tm); | 97 | return 0; |
98 | } | 98 | } |
99 | 99 | ||
100 | static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) | 100 | static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) |
diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c index 8895f77726e8..e5222c5d8223 100644 --- a/drivers/rtc/rtc-pcf2123.c +++ b/drivers/rtc/rtc-pcf2123.c | |||
@@ -289,7 +289,7 @@ static int pcf2123_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
289 | tm->tm_sec, tm->tm_min, tm->tm_hour, | 289 | tm->tm_sec, tm->tm_min, tm->tm_hour, |
290 | tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); | 290 | tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); |
291 | 291 | ||
292 | return rtc_valid_tm(tm); | 292 | return 0; |
293 | } | 293 | } |
294 | 294 | ||
295 | static int pcf2123_rtc_set_time(struct device *dev, struct rtc_time *tm) | 295 | static int pcf2123_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index f33447c5db85..e83be1852c2f 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c | |||
@@ -111,7 +111,7 @@ static int pcf2127_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
111 | tm->tm_sec, tm->tm_min, tm->tm_hour, | 111 | tm->tm_sec, tm->tm_min, tm->tm_hour, |
112 | tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); | 112 | tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); |
113 | 113 | ||
114 | return rtc_valid_tm(tm); | 114 | return 0; |
115 | } | 115 | } |
116 | 116 | ||
117 | static int pcf2127_rtc_set_time(struct device *dev, struct rtc_time *tm) | 117 | static int pcf2127_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c index 00c31c91b245..ef72b0c389d7 100644 --- a/drivers/rtc/rtc-pcf50633.c +++ b/drivers/rtc/rtc-pcf50633.c | |||
@@ -135,7 +135,7 @@ static int pcf50633_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
135 | tm->tm_mday, tm->tm_mon, tm->tm_year, | 135 | tm->tm_mday, tm->tm_mon, tm->tm_year, |
136 | tm->tm_hour, tm->tm_min, tm->tm_sec); | 136 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
137 | 137 | ||
138 | return rtc_valid_tm(tm); | 138 | return 0; |
139 | } | 139 | } |
140 | 140 | ||
141 | static int pcf50633_rtc_set_time(struct device *dev, struct rtc_time *tm) | 141 | static int pcf50633_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c index c312af0db729..453615f8ac9a 100644 --- a/drivers/rtc/rtc-pcf8523.c +++ b/drivers/rtc/rtc-pcf8523.c | |||
@@ -192,7 +192,7 @@ static int pcf8523_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
192 | tm->tm_mon = bcd2bin(regs[5] & 0x1f) - 1; | 192 | tm->tm_mon = bcd2bin(regs[5] & 0x1f) - 1; |
193 | tm->tm_year = bcd2bin(regs[6]) + 100; | 193 | tm->tm_year = bcd2bin(regs[6]) + 100; |
194 | 194 | ||
195 | return rtc_valid_tm(tm); | 195 | return 0; |
196 | } | 196 | } |
197 | 197 | ||
198 | static int pcf8523_rtc_set_time(struct device *dev, struct rtc_time *tm) | 198 | static int pcf8523_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c index 5cfb6df5c430..3c08eab4f1a8 100644 --- a/drivers/rtc/rtc-pic32.c +++ b/drivers/rtc/rtc-pic32.c | |||
@@ -175,7 +175,7 @@ static int pic32_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) | |||
175 | rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec); | 175 | rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec); |
176 | 176 | ||
177 | clk_disable(pdata->clk); | 177 | clk_disable(pdata->clk); |
178 | return rtc_valid_tm(rtc_tm); | 178 | return 0; |
179 | } | 179 | } |
180 | 180 | ||
181 | static int pic32_rtc_settime(struct device *dev, struct rtc_time *tm) | 181 | static int pic32_rtc_settime(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c index b6c5eb97051c..a39ccd1cf6e8 100644 --- a/drivers/rtc/rtc-r9701.c +++ b/drivers/rtc/rtc-r9701.c | |||
@@ -92,7 +92,7 @@ static int r9701_get_datetime(struct device *dev, struct rtc_time *dt) | |||
92 | * according to the data sheet. make sure they are valid. | 92 | * according to the data sheet. make sure they are valid. |
93 | */ | 93 | */ |
94 | 94 | ||
95 | return rtc_valid_tm(dt); | 95 | return 0; |
96 | } | 96 | } |
97 | 97 | ||
98 | static int r9701_set_datetime(struct device *dev, struct rtc_time *dt) | 98 | static int r9701_set_datetime(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-rp5c01.c b/drivers/rtc/rtc-rp5c01.c index 043b1667b41a..f1c160fe7d37 100644 --- a/drivers/rtc/rtc-rp5c01.c +++ b/drivers/rtc/rtc-rp5c01.c | |||
@@ -115,7 +115,7 @@ static int rp5c01_read_time(struct device *dev, struct rtc_time *tm) | |||
115 | rp5c01_unlock(priv); | 115 | rp5c01_unlock(priv); |
116 | spin_unlock_irq(&priv->lock); | 116 | spin_unlock_irq(&priv->lock); |
117 | 117 | ||
118 | return rtc_valid_tm(tm); | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | static int rp5c01_set_time(struct device *dev, struct rtc_time *tm) | 121 | static int rp5c01_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-rx6110.c b/drivers/rtc/rtc-rx6110.c index 7c9c08eab5e5..8e322d884cc2 100644 --- a/drivers/rtc/rtc-rx6110.c +++ b/drivers/rtc/rtc-rx6110.c | |||
@@ -252,7 +252,7 @@ static int rx6110_get_time(struct device *dev, struct rtc_time *tm) | |||
252 | tm->tm_sec, tm->tm_min, tm->tm_hour, | 252 | tm->tm_sec, tm->tm_min, tm->tm_hour, |
253 | tm->tm_mday, tm->tm_mon, tm->tm_year); | 253 | tm->tm_mday, tm->tm_mon, tm->tm_year); |
254 | 254 | ||
255 | return rtc_valid_tm(tm); | 255 | return 0; |
256 | } | 256 | } |
257 | 257 | ||
258 | static const struct reg_sequence rx6110_default_regs[] = { | 258 | static const struct reg_sequence rx6110_default_regs[] = { |
diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c index 5c5938ab3d86..7ddc22eb5b0f 100644 --- a/drivers/rtc/rtc-rx8010.c +++ b/drivers/rtc/rtc-rx8010.c | |||
@@ -138,7 +138,7 @@ static int rx8010_get_time(struct device *dev, struct rtc_time *dt) | |||
138 | dt->tm_year = bcd2bin(date[RX8010_YEAR - RX8010_SEC]) + 100; | 138 | dt->tm_year = bcd2bin(date[RX8010_YEAR - RX8010_SEC]) + 100; |
139 | dt->tm_wday = ffs(date[RX8010_WDAY - RX8010_SEC] & 0x7f); | 139 | dt->tm_wday = ffs(date[RX8010_WDAY - RX8010_SEC] & 0x7f); |
140 | 140 | ||
141 | return rtc_valid_tm(dt); | 141 | return 0; |
142 | } | 142 | } |
143 | 143 | ||
144 | static int rx8010_set_time(struct device *dev, struct rtc_time *dt) | 144 | static int rx8010_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index 91857d8d2df8..41127adf5765 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c | |||
@@ -214,7 +214,7 @@ static int rx8025_get_time(struct device *dev, struct rtc_time *dt) | |||
214 | dt->tm_sec, dt->tm_min, dt->tm_hour, | 214 | dt->tm_sec, dt->tm_min, dt->tm_hour, |
215 | dt->tm_mday, dt->tm_mon, dt->tm_year); | 215 | dt->tm_mday, dt->tm_mon, dt->tm_year); |
216 | 216 | ||
217 | return rtc_valid_tm(dt); | 217 | return 0; |
218 | } | 218 | } |
219 | 219 | ||
220 | static int rx8025_set_time(struct device *dev, struct rtc_time *dt) | 220 | static int rx8025_set_time(struct device *dev, struct rtc_time *dt) |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index a8992c227f61..75c8c5033e08 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
@@ -232,7 +232,7 @@ retry_get_time: | |||
232 | 232 | ||
233 | rtc_tm->tm_mon -= 1; | 233 | rtc_tm->tm_mon -= 1; |
234 | 234 | ||
235 | return rtc_valid_tm(rtc_tm); | 235 | return 0; |
236 | } | 236 | } |
237 | 237 | ||
238 | static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm) | 238 | static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index 0477678d968f..6deae10c14ac 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c | |||
@@ -407,7 +407,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
407 | 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, | 407 | 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, |
408 | tm->tm_hour, tm->tm_min, tm->tm_sec, tm->tm_wday); | 408 | tm->tm_hour, tm->tm_min, tm->tm_sec, tm->tm_wday); |
409 | 409 | ||
410 | return rtc_valid_tm(tm); | 410 | return 0; |
411 | } | 411 | } |
412 | 412 | ||
413 | static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm) | 413 | static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 6c2d3989f967..4e8ab370ce63 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
@@ -414,7 +414,7 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
414 | tm->tm_sec, tm->tm_min, tm->tm_hour, | 414 | tm->tm_sec, tm->tm_min, tm->tm_hour, |
415 | tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday); | 415 | tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday); |
416 | 416 | ||
417 | return rtc_valid_tm(tm); | 417 | return 0; |
418 | } | 418 | } |
419 | 419 | ||
420 | static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm) | 420 | static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm) |
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 5bc28eed1adf..2e6fb275acc8 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c | |||
@@ -349,7 +349,7 @@ static int sun6i_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) | |||
349 | */ | 349 | */ |
350 | rtc_tm->tm_year += SUN6I_YEAR_OFF; | 350 | rtc_tm->tm_year += SUN6I_YEAR_OFF; |
351 | 351 | ||
352 | return rtc_valid_tm(rtc_tm); | 352 | return 0; |
353 | } | 353 | } |
354 | 354 | ||
355 | static int sun6i_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm) | 355 | static int sun6i_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm) |
diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c index abada609ddc7..dadbf8b324ad 100644 --- a/drivers/rtc/rtc-sunxi.c +++ b/drivers/rtc/rtc-sunxi.c | |||
@@ -261,7 +261,7 @@ static int sunxi_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) | |||
261 | */ | 261 | */ |
262 | rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year); | 262 | rtc_tm->tm_year += SUNXI_YEAR_OFF(chip->data_year); |
263 | 263 | ||
264 | return rtc_valid_tm(rtc_tm); | 264 | return 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | static int sunxi_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm) | 267 | static int sunxi_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm) |