Lines Matching refs:tm
51 void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) in rtc_time_to_tm() argument
60 tm->tm_wday = (days + 4) % 7; in rtc_time_to_tm()
70 tm->tm_year = year - 1900; in rtc_time_to_tm()
71 tm->tm_yday = days + 1; in rtc_time_to_tm()
81 tm->tm_mon = month; in rtc_time_to_tm()
82 tm->tm_mday = days + 1; in rtc_time_to_tm()
84 tm->tm_hour = time / 3600; in rtc_time_to_tm()
85 time -= tm->tm_hour * 3600; in rtc_time_to_tm()
86 tm->tm_min = time / 60; in rtc_time_to_tm()
87 tm->tm_sec = time - tm->tm_min * 60; in rtc_time_to_tm()
89 tm->tm_isdst = 0; in rtc_time_to_tm()
96 int rtc_valid_tm(struct rtc_time *tm) in rtc_valid_tm() argument
98 if (tm->tm_year < 70 in rtc_valid_tm()
99 || ((unsigned)tm->tm_mon) >= 12 in rtc_valid_tm()
100 || tm->tm_mday < 1 in rtc_valid_tm()
101 || tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + 1900) in rtc_valid_tm()
102 || ((unsigned)tm->tm_hour) >= 24 in rtc_valid_tm()
103 || ((unsigned)tm->tm_min) >= 60 in rtc_valid_tm()
104 || ((unsigned)tm->tm_sec) >= 60) in rtc_valid_tm()
114 int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time) in rtc_tm_to_time() argument
116 *time = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, in rtc_tm_to_time()
117 tm->tm_hour, tm->tm_min, tm->tm_sec); in rtc_tm_to_time()
125 ktime_t rtc_tm_to_ktime(struct rtc_time tm) in rtc_tm_to_ktime() argument
128 rtc_tm_to_time(&tm, &time); in rtc_tm_to_ktime()