summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-da9052.c
diff options
context:
space:
mode:
authorUwe Kleine-König <uwe@kleine-koenig.org>2016-07-11 10:05:27 +0200
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-07-19 18:15:21 +0200
commitd2c92705c54c9c24f2b8be57b968ad21a30412e5 (patch)
treeef386f3b15925c3d1b1d8aebf4e0e774ec7f74cd /drivers/rtc/rtc-da9052.c
parent70c96dfac0e231424e17743bd52f6cd2ff1f2439 (diff)
downloadlinux-d2c92705c54c9c24f2b8be57b968ad21a30412e5.tar.bz2
rtc: explicitly set tm_sec = 0 for drivers with minute accurancy
Since all time members of the alarm data is initialized to -1 the drivers are responsible to set the tm_sec member to 0. Fixes: d68778b80dd7 ("rtc: initialize output parameter for read alarm to "uninitialized"") 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-da9052.c')
-rw-r--r--drivers/rtc/rtc-da9052.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
index a20bcf0e33cd..4273377562ec 100644
--- a/drivers/rtc/rtc-da9052.c
+++ b/drivers/rtc/rtc-da9052.c
@@ -85,6 +85,7 @@ static int da9052_read_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm)
rtc_tm->tm_mday = v[0][2] & DA9052_RTC_DAY;
rtc_tm->tm_hour = v[0][1] & DA9052_RTC_HOUR;
rtc_tm->tm_min = v[0][0] & DA9052_RTC_MIN;
+ rtc_tm->tm_sec = 0;
ret = rtc_valid_tm(rtc_tm);
return ret;