Commit 99b7ac9c authored by Alexandre Belloni's avatar Alexandre Belloni
Browse files

rtc: sun6i: switch to rtc_time64_to_tm/rtc_tm_to_time64

parent fd90d48d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ static int sun6i_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm)

	wkalrm->enabled = !!(alrm_en & SUN6I_ALRM_EN_CNT_EN);
	wkalrm->pending = !!(alrm_st & SUN6I_ALRM_EN_CNT_EN);
	rtc_time_to_tm(chip->alarm, &wkalrm->time);
	rtc_time64_to_tm(chip->alarm, &wkalrm->time);

	return 0;
}
@@ -520,8 +520,8 @@ static int sun6i_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm)
		return -EINVAL;
	}

	rtc_tm_to_time(alrm_tm, &time_set);
	rtc_tm_to_time(&tm_now, &time_now);
	time_set = rtc_tm_to_time64(alrm_tm);
	time_now = rtc_tm_to_time64(&tm_now);
	if (time_set <= time_now) {
		dev_err(dev, "Date to set in the past\n");
		return -EINVAL;