@@ -57,7 +57,7 @@ void vrtc_cmos_write(unsigned char val, unsigned char reg)
57
57
}
58
58
EXPORT_SYMBOL_GPL (vrtc_cmos_write );
59
59
60
- void vrtc_get_time (struct timespec * now )
60
+ void vrtc_get_time (struct timespec64 * now )
61
61
{
62
62
u8 sec , min , hour , mday , mon ;
63
63
unsigned long flags ;
@@ -83,18 +83,18 @@ void vrtc_get_time(struct timespec *now)
83
83
pr_info ("vRTC: sec: %d min: %d hour: %d day: %d "
84
84
"mon: %d year: %d\n" , sec , min , hour , mday , mon , year );
85
85
86
- now -> tv_sec = mktime (year , mon , mday , hour , min , sec );
86
+ now -> tv_sec = mktime64 (year , mon , mday , hour , min , sec );
87
87
now -> tv_nsec = 0 ;
88
88
}
89
89
90
- int vrtc_set_mmss (const struct timespec * now )
90
+ int vrtc_set_mmss (const struct timespec64 * now )
91
91
{
92
92
unsigned long flags ;
93
93
struct rtc_time tm ;
94
94
int year ;
95
95
int retval = 0 ;
96
96
97
- rtc_time_to_tm (now -> tv_sec , & tm );
97
+ rtc_time64_to_tm (now -> tv_sec , & tm );
98
98
if (!rtc_valid_tm (& tm ) && tm .tm_year >= 72 ) {
99
99
/*
100
100
* tm.year is the number of years since 1900, and the
@@ -110,8 +110,8 @@ int vrtc_set_mmss(const struct timespec *now)
110
110
vrtc_cmos_write (tm .tm_sec , RTC_SECONDS );
111
111
spin_unlock_irqrestore (& rtc_lock , flags );
112
112
} else {
113
- pr_err ("%s: Invalid vRTC value: write of %lx to vRTC failed\n" ,
114
- __func__ , now -> tv_sec );
113
+ pr_err ("%s: Invalid vRTC value: write of %llx to vRTC failed\n" ,
114
+ __func__ , ( s64 ) now -> tv_sec );
115
115
retval = - EINVAL ;
116
116
}
117
117
return retval ;
0 commit comments