|
@@ -88,7 +88,7 @@ static unsigned int alarm_enabled;
|
|
|
static int aie_irq;
|
|
|
static int pie_irq;
|
|
|
|
|
|
-static inline unsigned long read_elapsed_second(void)
|
|
|
+static inline time64_t read_elapsed_second(void)
|
|
|
{
|
|
|
|
|
|
unsigned long first_low, first_mid, first_high;
|
|
@@ -105,10 +105,10 @@ static inline unsigned long read_elapsed_second(void)
|
|
|
} while (first_low != second_low || first_mid != second_mid ||
|
|
|
first_high != second_high);
|
|
|
|
|
|
- return (first_high << 17) | (first_mid << 1) | (first_low >> 15);
|
|
|
+ return ((u64)first_high << 17) | (first_mid << 1) | (first_low >> 15);
|
|
|
}
|
|
|
|
|
|
-static inline void write_elapsed_second(unsigned long sec)
|
|
|
+static inline void write_elapsed_second(time64_t sec)
|
|
|
{
|
|
|
spin_lock_irq(&rtc_lock);
|
|
|
|
|
@@ -121,22 +121,22 @@ static inline void write_elapsed_second(unsigned long sec)
|
|
|
|
|
|
static int vr41xx_rtc_read_time(struct device *dev, struct rtc_time *time)
|
|
|
{
|
|
|
- unsigned long epoch_sec, elapsed_sec;
|
|
|
+ time64_t epoch_sec, elapsed_sec;
|
|
|
|
|
|
- epoch_sec = mktime(epoch, 1, 1, 0, 0, 0);
|
|
|
+ epoch_sec = mktime64(epoch, 1, 1, 0, 0, 0);
|
|
|
elapsed_sec = read_elapsed_second();
|
|
|
|
|
|
- rtc_time_to_tm(epoch_sec + elapsed_sec, time);
|
|
|
+ rtc_time64_to_tm(epoch_sec + elapsed_sec, time);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
static int vr41xx_rtc_set_time(struct device *dev, struct rtc_time *time)
|
|
|
{
|
|
|
- unsigned long epoch_sec, current_sec;
|
|
|
+ time64_t epoch_sec, current_sec;
|
|
|
|
|
|
- epoch_sec = mktime(epoch, 1, 1, 0, 0, 0);
|
|
|
- current_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
|
|
|
+ epoch_sec = mktime64(epoch, 1, 1, 0, 0, 0);
|
|
|
+ current_sec = mktime64(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
|
|
|
time->tm_hour, time->tm_min, time->tm_sec);
|
|
|
|
|
|
write_elapsed_second(current_sec - epoch_sec);
|
|
@@ -165,11 +165,11 @@ static int vr41xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
|
|
|
|
|
static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
|
|
{
|
|
|
- unsigned long alarm_sec;
|
|
|
+ time64_t alarm_sec;
|
|
|
struct rtc_time *time = &wkalrm->time;
|
|
|
|
|
|
- alarm_sec = mktime(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
|
|
|
- time->tm_hour, time->tm_min, time->tm_sec);
|
|
|
+ alarm_sec = mktime64(time->tm_year + 1900, time->tm_mon + 1, time->tm_mday,
|
|
|
+ time->tm_hour, time->tm_min, time->tm_sec);
|
|
|
|
|
|
spin_lock_irq(&rtc_lock);
|
|
|
|