diff options
author | Uwe Kleine-König <uwe@kleine-koenig.org> | 2016-06-28 04:43:45 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2016-07-09 04:24:45 -0400 |
commit | 56d86a7e799d3d893cb96f5b17b13de134af8de5 (patch) | |
tree | 2e88564cc608cc35a0d41fafdce4b8a3af06e54c | |
parent | e29385fab0bf94017fac130ee32f5bb2daf74417 (diff) |
rtc: simplify implementations of read_alarm
Since commit d68778b80dd7 ("rtc: initialize output parameter for read
alarm to "uninitialized"") there is no need to explicitly set
unsupported members to -1. So drop the respective assignments from
drivers.
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1305.c | 7 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1307.c | 5 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1343.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1685.c | 19 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds3232.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc-hym8563.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-mrst.c | 8 | ||||
-rw-r--r-- | drivers/rtc/rtc-pcf8563.c | 4 | ||||
-rw-r--r-- | drivers/rtc/rtc-rs5c372.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc-rv8803.c | 3 | ||||
-rw-r--r-- | drivers/rtc/rtc-rx8010.c | 8 | ||||
-rw-r--r-- | drivers/rtc/rtc-rx8025.c | 5 | ||||
-rw-r--r-- | drivers/rtc/rtc-s3c.c | 12 | ||||
-rw-r--r-- | drivers/rtc/rtc-tegra.c | 6 |
16 files changed, 5 insertions, 98 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index f9fdb6fc641c..43745cac0141 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -220,8 +220,6 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
220 | * Some also support day and month, for alarms up to a year in | 220 | * Some also support day and month, for alarms up to a year in |
221 | * the future. | 221 | * the future. |
222 | */ | 222 | */ |
223 | t->time.tm_mday = -1; | ||
224 | t->time.tm_mon = -1; | ||
225 | 223 | ||
226 | spin_lock_irq(&rtc_lock); | 224 | spin_lock_irq(&rtc_lock); |
227 | t->time.tm_sec = CMOS_READ(RTC_SECONDS_ALARM); | 225 | t->time.tm_sec = CMOS_READ(RTC_SECONDS_ALARM); |
@@ -272,7 +270,6 @@ static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
272 | } | 270 | } |
273 | } | 271 | } |
274 | } | 272 | } |
275 | t->time.tm_year = -1; | ||
276 | 273 | ||
277 | t->enabled = !!(rtc_control & RTC_AIE); | 274 | t->enabled = !!(rtc_control & RTC_AIE); |
278 | t->pending = 0; | 275 | t->pending = 0; |
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 8e41c4613e51..72b22935eb62 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c | |||
@@ -313,13 +313,6 @@ static int ds1305_get_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
313 | alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); | 313 | alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); |
314 | alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); | 314 | alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); |
315 | alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); | 315 | alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); |
316 | alm->time.tm_mday = -1; | ||
317 | alm->time.tm_mon = -1; | ||
318 | alm->time.tm_year = -1; | ||
319 | /* next three fields are unused by Linux */ | ||
320 | alm->time.tm_wday = -1; | ||
321 | alm->time.tm_mday = -1; | ||
322 | alm->time.tm_isdst = -1; | ||
323 | 316 | ||
324 | return 0; | 317 | return 0; |
325 | } | 318 | } |
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index f25f7dce6e1f..8e1c5cb6ece6 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
@@ -482,11 +482,6 @@ static int ds1337_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
482 | t->time.tm_min = bcd2bin(ds1307->regs[1] & 0x7f); | 482 | t->time.tm_min = bcd2bin(ds1307->regs[1] & 0x7f); |
483 | t->time.tm_hour = bcd2bin(ds1307->regs[2] & 0x3f); | 483 | t->time.tm_hour = bcd2bin(ds1307->regs[2] & 0x3f); |
484 | t->time.tm_mday = bcd2bin(ds1307->regs[3] & 0x3f); | 484 | t->time.tm_mday = bcd2bin(ds1307->regs[3] & 0x3f); |
485 | t->time.tm_mon = -1; | ||
486 | t->time.tm_year = -1; | ||
487 | t->time.tm_wday = -1; | ||
488 | t->time.tm_yday = -1; | ||
489 | t->time.tm_isdst = -1; | ||
490 | 485 | ||
491 | /* ... and status */ | 486 | /* ... and status */ |
492 | t->enabled = !!(ds1307->regs[7] & DS1337_BIT_A1IE); | 487 | t->enabled = !!(ds1307->regs[7] & DS1337_BIT_A1IE); |
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 23fa9f0cb5e3..895fbeeb47fe 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c | |||
@@ -504,12 +504,6 @@ static int ds1343_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) | |||
504 | alarm->time.tm_hour = priv->alarm_hour < 0 ? 0 : priv->alarm_hour; | 504 | alarm->time.tm_hour = priv->alarm_hour < 0 ? 0 : priv->alarm_hour; |
505 | alarm->time.tm_mday = priv->alarm_mday < 0 ? 0 : priv->alarm_mday; | 505 | alarm->time.tm_mday = priv->alarm_mday < 0 ? 0 : priv->alarm_mday; |
506 | 506 | ||
507 | alarm->time.tm_mon = -1; | ||
508 | alarm->time.tm_year = -1; | ||
509 | alarm->time.tm_wday = -1; | ||
510 | alarm->time.tm_yday = -1; | ||
511 | alarm->time.tm_isdst = -1; | ||
512 | |||
513 | out: | 507 | out: |
514 | mutex_unlock(&priv->mutex); | 508 | mutex_unlock(&priv->mutex); |
515 | return res; | 509 | return res; |
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index 68197042feb7..ed43b4311660 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c | |||
@@ -419,25 +419,19 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
419 | * | 419 | * |
420 | * The Linux RTC system doesn't support the "don't care" capability | 420 | * The Linux RTC system doesn't support the "don't care" capability |
421 | * of this RTC chip. We check for it anyways in case support is | 421 | * of this RTC chip. We check for it anyways in case support is |
422 | * added in the future. | 422 | * added in the future and only assign when we care. |
423 | */ | 423 | */ |
424 | if (unlikely(seconds >= 0xc0)) | 424 | if (likely(seconds < 0xc0)) |
425 | alrm->time.tm_sec = -1; | ||
426 | else | ||
427 | alrm->time.tm_sec = ds1685_rtc_bcd2bin(rtc, seconds, | 425 | alrm->time.tm_sec = ds1685_rtc_bcd2bin(rtc, seconds, |
428 | RTC_SECS_BCD_MASK, | 426 | RTC_SECS_BCD_MASK, |
429 | RTC_SECS_BIN_MASK); | 427 | RTC_SECS_BIN_MASK); |
430 | 428 | ||
431 | if (unlikely(minutes >= 0xc0)) | 429 | if (likely(minutes < 0xc0)) |
432 | alrm->time.tm_min = -1; | ||
433 | else | ||
434 | alrm->time.tm_min = ds1685_rtc_bcd2bin(rtc, minutes, | 430 | alrm->time.tm_min = ds1685_rtc_bcd2bin(rtc, minutes, |
435 | RTC_MINS_BCD_MASK, | 431 | RTC_MINS_BCD_MASK, |
436 | RTC_MINS_BIN_MASK); | 432 | RTC_MINS_BIN_MASK); |
437 | 433 | ||
438 | if (unlikely(hours >= 0xc0)) | 434 | if (likely(hours < 0xc0)) |
439 | alrm->time.tm_hour = -1; | ||
440 | else | ||
441 | alrm->time.tm_hour = ds1685_rtc_bcd2bin(rtc, hours, | 435 | alrm->time.tm_hour = ds1685_rtc_bcd2bin(rtc, hours, |
442 | RTC_HRS_24_BCD_MASK, | 436 | RTC_HRS_24_BCD_MASK, |
443 | RTC_HRS_24_BIN_MASK); | 437 | RTC_HRS_24_BIN_MASK); |
@@ -445,11 +439,6 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
445 | /* Write the data to rtc_wkalrm. */ | 439 | /* Write the data to rtc_wkalrm. */ |
446 | alrm->time.tm_mday = ds1685_rtc_bcd2bin(rtc, mday, RTC_MDAY_BCD_MASK, | 440 | alrm->time.tm_mday = ds1685_rtc_bcd2bin(rtc, mday, RTC_MDAY_BCD_MASK, |
447 | RTC_MDAY_BIN_MASK); | 441 | RTC_MDAY_BIN_MASK); |
448 | alrm->time.tm_mon = -1; | ||
449 | alrm->time.tm_year = -1; | ||
450 | alrm->time.tm_wday = -1; | ||
451 | alrm->time.tm_yday = -1; | ||
452 | alrm->time.tm_isdst = -1; | ||
453 | alrm->enabled = !!(ctrlb & RTC_CTRL_B_AIE); | 442 | alrm->enabled = !!(ctrlb & RTC_CTRL_B_AIE); |
454 | alrm->pending = !!(ctrlc & RTC_CTRL_C_AF); | 443 | alrm->pending = !!(ctrlc & RTC_CTRL_C_AF); |
455 | 444 | ||
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 04fbd7fffd0d..b1f20d8c358f 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c | |||
@@ -197,12 +197,6 @@ static int ds3232_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) | |||
197 | alarm->time.tm_hour = bcd2bin(buf[2] & 0x7F); | 197 | alarm->time.tm_hour = bcd2bin(buf[2] & 0x7F); |
198 | alarm->time.tm_mday = bcd2bin(buf[3] & 0x7F); | 198 | alarm->time.tm_mday = bcd2bin(buf[3] & 0x7F); |
199 | 199 | ||
200 | alarm->time.tm_mon = -1; | ||
201 | alarm->time.tm_year = -1; | ||
202 | alarm->time.tm_wday = -1; | ||
203 | alarm->time.tm_yday = -1; | ||
204 | alarm->time.tm_isdst = -1; | ||
205 | |||
206 | alarm->enabled = !!(control & DS3232_REG_CR_A1IE); | 200 | alarm->enabled = !!(control & DS3232_REG_CR_A1IE); |
207 | alarm->pending = !!(stat & DS3232_REG_SR_A1F); | 201 | alarm->pending = !!(stat & DS3232_REG_SR_A1F); |
208 | 202 | ||
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index 207270376b55..795a3f517cd0 100644 --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c | |||
@@ -213,9 +213,6 @@ static int hym8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
213 | -1 : | 213 | -1 : |
214 | bcd2bin(buf[3] & HYM8563_WEEKDAY_MASK); | 214 | bcd2bin(buf[3] & HYM8563_WEEKDAY_MASK); |
215 | 215 | ||
216 | alm_tm->tm_mon = -1; | ||
217 | alm_tm->tm_year = -1; | ||
218 | |||
219 | ret = i2c_smbus_read_byte_data(client, HYM8563_CTL2); | 216 | ret = i2c_smbus_read_byte_data(client, HYM8563_CTL2); |
220 | if (ret < 0) | 217 | if (ret < 0) |
221 | return ret; | 218 | return ret; |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index d1bf93a87200..c829bc45a371 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -320,10 +320,8 @@ static int m41t80_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
320 | alrm->time.tm_sec = bcd2bin(alarmvals[4] & 0x7f); | 320 | alrm->time.tm_sec = bcd2bin(alarmvals[4] & 0x7f); |
321 | alrm->time.tm_min = bcd2bin(alarmvals[3] & 0x7f); | 321 | alrm->time.tm_min = bcd2bin(alarmvals[3] & 0x7f); |
322 | alrm->time.tm_hour = bcd2bin(alarmvals[2] & 0x3f); | 322 | alrm->time.tm_hour = bcd2bin(alarmvals[2] & 0x3f); |
323 | alrm->time.tm_wday = -1; | ||
324 | alrm->time.tm_mday = bcd2bin(alarmvals[1] & 0x3f); | 323 | alrm->time.tm_mday = bcd2bin(alarmvals[1] & 0x3f); |
325 | alrm->time.tm_mon = bcd2bin(alarmvals[0] & 0x3f); | 324 | alrm->time.tm_mon = bcd2bin(alarmvals[0] & 0x3f); |
326 | alrm->time.tm_year = -1; | ||
327 | 325 | ||
328 | alrm->enabled = !!(alarmvals[0] & M41T80_ALMON_AFE); | 326 | alrm->enabled = !!(alarmvals[0] & M41T80_ALMON_AFE); |
329 | alrm->pending = (flags & M41T80_FLAGS_AF) && alrm->enabled; | 327 | alrm->pending = (flags & M41T80_FLAGS_AF) && alrm->enabled; |
diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c index fe840c0edfef..7334c44fa7c3 100644 --- a/drivers/rtc/rtc-mrst.c +++ b/drivers/rtc/rtc-mrst.c | |||
@@ -149,14 +149,6 @@ static int mrst_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
149 | if (mrst->irq <= 0) | 149 | if (mrst->irq <= 0) |
150 | return -EIO; | 150 | return -EIO; |
151 | 151 | ||
152 | /* Basic alarms only support hour, minute, and seconds fields. | ||
153 | * Some also support day and month, for alarms up to a year in | ||
154 | * the future. | ||
155 | */ | ||
156 | t->time.tm_mday = -1; | ||
157 | t->time.tm_mon = -1; | ||
158 | t->time.tm_year = -1; | ||
159 | |||
160 | /* vRTC only supports binary mode */ | 152 | /* vRTC only supports binary mode */ |
161 | spin_lock_irq(&rtc_lock); | 153 | spin_lock_irq(&rtc_lock); |
162 | t->time.tm_sec = vrtc_cmos_read(RTC_SECONDS_ALARM); | 154 | t->time.tm_sec = vrtc_cmos_read(RTC_SECONDS_ALARM); |
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index b9ddbb001283..26091a48925f 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c | |||
@@ -345,10 +345,6 @@ static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm) | |||
345 | tm->time.tm_hour = bcd2bin(buf[1] & 0x3F); | 345 | tm->time.tm_hour = bcd2bin(buf[1] & 0x3F); |
346 | tm->time.tm_mday = bcd2bin(buf[2] & 0x3F); | 346 | tm->time.tm_mday = bcd2bin(buf[2] & 0x3F); |
347 | tm->time.tm_wday = bcd2bin(buf[3] & 0x7); | 347 | tm->time.tm_wday = bcd2bin(buf[3] & 0x7); |
348 | tm->time.tm_mon = -1; | ||
349 | tm->time.tm_year = -1; | ||
350 | tm->time.tm_yday = -1; | ||
351 | tm->time.tm_isdst = -1; | ||
352 | 348 | ||
353 | err = pcf8563_get_alarm_mode(client, &tm->enabled, &tm->pending); | 349 | err = pcf8563_get_alarm_mode(client, &tm->enabled, &tm->pending); |
354 | if (err < 0) | 350 | if (err < 0) |
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index ef86229428fc..c8c757466783 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c | |||
@@ -341,12 +341,6 @@ static int rs5c_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
341 | t->time.tm_sec = 0; | 341 | t->time.tm_sec = 0; |
342 | t->time.tm_min = bcd2bin(rs5c->regs[RS5C_REG_ALARM_A_MIN] & 0x7f); | 342 | t->time.tm_min = bcd2bin(rs5c->regs[RS5C_REG_ALARM_A_MIN] & 0x7f); |
343 | t->time.tm_hour = rs5c_reg2hr(rs5c, rs5c->regs[RS5C_REG_ALARM_A_HOURS]); | 343 | t->time.tm_hour = rs5c_reg2hr(rs5c, rs5c->regs[RS5C_REG_ALARM_A_HOURS]); |
344 | t->time.tm_mday = -1; | ||
345 | t->time.tm_mon = -1; | ||
346 | t->time.tm_year = -1; | ||
347 | t->time.tm_wday = -1; | ||
348 | t->time.tm_yday = -1; | ||
349 | t->time.tm_isdst = -1; | ||
350 | 344 | ||
351 | /* ... and status */ | 345 | /* ... and status */ |
352 | t->enabled = !!(rs5c->regs[RS5C_REG_CTRL1] & RS5C_CTRL1_AALE); | 346 | t->enabled = !!(rs5c->regs[RS5C_REG_CTRL1] & RS5C_CTRL1_AALE); |
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c index 022ef26bef47..05c79c38689d 100644 --- a/drivers/rtc/rtc-rv8803.c +++ b/drivers/rtc/rtc-rv8803.c | |||
@@ -210,10 +210,7 @@ static int rv8803_get_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
210 | alrm->time.tm_sec = 0; | 210 | alrm->time.tm_sec = 0; |
211 | alrm->time.tm_min = bcd2bin(alarmvals[0] & 0x7f); | 211 | alrm->time.tm_min = bcd2bin(alarmvals[0] & 0x7f); |
212 | alrm->time.tm_hour = bcd2bin(alarmvals[1] & 0x3f); | 212 | alrm->time.tm_hour = bcd2bin(alarmvals[1] & 0x3f); |
213 | alrm->time.tm_wday = -1; | ||
214 | alrm->time.tm_mday = bcd2bin(alarmvals[2] & 0x3f); | 213 | alrm->time.tm_mday = bcd2bin(alarmvals[2] & 0x3f); |
215 | alrm->time.tm_mon = -1; | ||
216 | alrm->time.tm_year = -1; | ||
217 | 214 | ||
218 | alrm->enabled = !!(rv8803->ctrl & RV8803_CTRL_AIE); | 215 | alrm->enabled = !!(rv8803->ctrl & RV8803_CTRL_AIE); |
219 | alrm->pending = (flags & RV8803_FLAG_AF) && alrm->enabled; | 216 | alrm->pending = (flags & RV8803_FLAG_AF) && alrm->enabled; |
diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c index 772d221ec2d9..7163b91bb773 100644 --- a/drivers/rtc/rtc-rx8010.c +++ b/drivers/rtc/rtc-rx8010.c | |||
@@ -272,15 +272,9 @@ static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
272 | t->time.tm_min = bcd2bin(alarmvals[0] & 0x7f); | 272 | t->time.tm_min = bcd2bin(alarmvals[0] & 0x7f); |
273 | t->time.tm_hour = bcd2bin(alarmvals[1] & 0x3f); | 273 | t->time.tm_hour = bcd2bin(alarmvals[1] & 0x3f); |
274 | 274 | ||
275 | if (alarmvals[2] & RX8010_ALARM_AE) | 275 | if (!(alarmvals[2] & RX8010_ALARM_AE)) |
276 | t->time.tm_mday = -1; | ||
277 | else | ||
278 | t->time.tm_mday = bcd2bin(alarmvals[2] & 0x7f); | 276 | t->time.tm_mday = bcd2bin(alarmvals[2] & 0x7f); |
279 | 277 | ||
280 | t->time.tm_wday = -1; | ||
281 | t->time.tm_mon = -1; | ||
282 | t->time.tm_year = -1; | ||
283 | |||
284 | t->enabled = !!(rx8010->ctrlreg & RX8010_CTRL_AIE); | 278 | t->enabled = !!(rx8010->ctrlreg & RX8010_CTRL_AIE); |
285 | t->pending = (flagreg & RX8010_FLAG_AF) && t->enabled; | 279 | t->pending = (flagreg & RX8010_FLAG_AF) && t->enabled; |
286 | 280 | ||
diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index 9f105efbc546..2b85cc7a24e7 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c | |||
@@ -319,11 +319,6 @@ static int rx8025_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
319 | t->time.tm_hour = bcd2bin(ald[1] & 0x1f) % 12 | 319 | t->time.tm_hour = bcd2bin(ald[1] & 0x1f) % 12 |
320 | + (ald[1] & 0x20 ? 12 : 0); | 320 | + (ald[1] & 0x20 ? 12 : 0); |
321 | 321 | ||
322 | t->time.tm_wday = -1; | ||
323 | t->time.tm_mday = -1; | ||
324 | t->time.tm_mon = -1; | ||
325 | t->time.tm_year = -1; | ||
326 | |||
327 | dev_dbg(dev, "%s: date: %ds %dm %dh %dmd %dm %dy\n", | 322 | dev_dbg(dev, "%s: date: %ds %dm %dh %dmd %dm %dy\n", |
328 | __func__, | 323 | __func__, |
329 | t->time.tm_sec, t->time.tm_min, t->time.tm_hour, | 324 | t->time.tm_sec, t->time.tm_min, t->time.tm_hour, |
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index d01ad7e8078e..6d25e373e246 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
@@ -264,35 +264,23 @@ static int s3c_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
264 | /* decode the alarm enable field */ | 264 | /* decode the alarm enable field */ |
265 | if (alm_en & S3C2410_RTCALM_SECEN) | 265 | if (alm_en & S3C2410_RTCALM_SECEN) |
266 | alm_tm->tm_sec = bcd2bin(alm_tm->tm_sec); | 266 | alm_tm->tm_sec = bcd2bin(alm_tm->tm_sec); |
267 | else | ||
268 | alm_tm->tm_sec = -1; | ||
269 | 267 | ||
270 | if (alm_en & S3C2410_RTCALM_MINEN) | 268 | if (alm_en & S3C2410_RTCALM_MINEN) |
271 | alm_tm->tm_min = bcd2bin(alm_tm->tm_min); | 269 | alm_tm->tm_min = bcd2bin(alm_tm->tm_min); |
272 | else | ||
273 | alm_tm->tm_min = -1; | ||
274 | 270 | ||
275 | if (alm_en & S3C2410_RTCALM_HOUREN) | 271 | if (alm_en & S3C2410_RTCALM_HOUREN) |
276 | alm_tm->tm_hour = bcd2bin(alm_tm->tm_hour); | 272 | alm_tm->tm_hour = bcd2bin(alm_tm->tm_hour); |
277 | else | ||
278 | alm_tm->tm_hour = -1; | ||
279 | 273 | ||
280 | if (alm_en & S3C2410_RTCALM_DAYEN) | 274 | if (alm_en & S3C2410_RTCALM_DAYEN) |
281 | alm_tm->tm_mday = bcd2bin(alm_tm->tm_mday); | 275 | alm_tm->tm_mday = bcd2bin(alm_tm->tm_mday); |
282 | else | ||
283 | alm_tm->tm_mday = -1; | ||
284 | 276 | ||
285 | if (alm_en & S3C2410_RTCALM_MONEN) { | 277 | if (alm_en & S3C2410_RTCALM_MONEN) { |
286 | alm_tm->tm_mon = bcd2bin(alm_tm->tm_mon); | 278 | alm_tm->tm_mon = bcd2bin(alm_tm->tm_mon); |
287 | alm_tm->tm_mon -= 1; | 279 | alm_tm->tm_mon -= 1; |
288 | } else { | ||
289 | alm_tm->tm_mon = -1; | ||
290 | } | 280 | } |
291 | 281 | ||
292 | if (alm_en & S3C2410_RTCALM_YEAREN) | 282 | if (alm_en & S3C2410_RTCALM_YEAREN) |
293 | alm_tm->tm_year = bcd2bin(alm_tm->tm_year); | 283 | alm_tm->tm_year = bcd2bin(alm_tm->tm_year); |
294 | else | ||
295 | alm_tm->tm_year = -1; | ||
296 | 284 | ||
297 | return 0; | 285 | return 0; |
298 | } | 286 | } |
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index 60232bd366ef..15ac597d54da 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c | |||
@@ -179,12 +179,6 @@ static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) | |||
179 | if (sec == 0) { | 179 | if (sec == 0) { |
180 | /* alarm is disabled. */ | 180 | /* alarm is disabled. */ |
181 | alarm->enabled = 0; | 181 | alarm->enabled = 0; |
182 | alarm->time.tm_mon = -1; | ||
183 | alarm->time.tm_mday = -1; | ||
184 | alarm->time.tm_year = -1; | ||
185 | alarm->time.tm_hour = -1; | ||
186 | alarm->time.tm_min = -1; | ||
187 | alarm->time.tm_sec = -1; | ||
188 | } else { | 182 | } else { |
189 | /* alarm is enabled. */ | 183 | /* alarm is enabled. */ |
190 | alarm->enabled = 1; | 184 | alarm->enabled = 1; |