Commit 06c4e103 authored by Alexandre Belloni's avatar Alexandre Belloni
Browse files

rtc: da9052: switch to rtc_time64_to_tm/rtc_tm_to_time64

parent 23af616c
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -103,13 +103,11 @@ static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm)
	int ret;
	uint8_t v[3];

	ret = rtc_tm_to_time(rtc_tm, &alm_time);
	if (ret != 0)
		return ret;
	alm_time = rtc_tm_to_time64(rtc_tm);

	if (rtc_tm->tm_sec > 0) {
		alm_time += 60 - rtc_tm->tm_sec;
		rtc_time_to_tm(alm_time, rtc_tm);
		rtc_time64_to_tm(alm_time, rtc_tm);
	}
	BUG_ON(rtc_tm->tm_sec); /* it will cause repeated irqs if not zero */