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 /drivers/rtc/rtc-rx8010.c | |
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>
Diffstat (limited to 'drivers/rtc/rtc-rx8010.c')
-rw-r--r-- | drivers/rtc/rtc-rx8010.c | 8 |
1 files changed, 1 insertions, 7 deletions
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 | ||