@@ -124,6 +124,15 @@ time64_t rtc_tm_to_time64(struct rtc_time *tm)
EXPORT_SYMBOL(rtc_tm_to_time64);
/*
+ * rtc_tm_subtract - Return the difference in seconds.
+ */
+time64_t rtc_tm_subtract(struct rtc_time *minuend, struct rtc_time *subtrahend)
+{
+ return rtc_tm_to_time64(minuend) - rtc_tm_to_time64(subtrahend);
+}
+EXPORT_SYMBOL_GPL(rtc_tm_subtract);
+
+/*
* Convert rtc_time to ktime
*/
ktime_t rtc_tm_to_ktime(struct rtc_time tm)
@@ -21,6 +21,8 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year
extern int rtc_valid_tm(struct rtc_time *tm);
extern time64_t rtc_tm_to_time64(struct rtc_time *tm);
extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm);
+extern time64_t rtc_tm_subtract(struct rtc_time *minuend,
+ struct rtc_time *subtrahend);
ktime_t rtc_tm_to_ktime(struct rtc_time tm);
struct rtc_time rtc_ktime_to_tm(ktime_t kt);