|
@@ -72,9 +72,10 @@ since_epoch_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
|
|
|
|
retval = rtc_read_time(to_rtc_device(dev), &tm);
|
|
retval = rtc_read_time(to_rtc_device(dev), &tm);
|
|
if (retval == 0) {
|
|
if (retval == 0) {
|
|
- unsigned long time;
|
|
|
|
- rtc_tm_to_time(&tm, &time);
|
|
|
|
- retval = sprintf(buf, "%lu\n", time);
|
|
|
|
|
|
+ time64_t time;
|
|
|
|
+
|
|
|
|
+ time = rtc_tm_to_time64(&tm);
|
|
|
|
+ retval = sprintf(buf, "%lld\n", time);
|
|
}
|
|
}
|
|
|
|
|
|
return retval;
|
|
return retval;
|
|
@@ -132,7 +133,7 @@ static ssize_t
|
|
wakealarm_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
wakealarm_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
{
|
|
{
|
|
ssize_t retval;
|
|
ssize_t retval;
|
|
- unsigned long alarm;
|
|
|
|
|
|
+ time64_t alarm;
|
|
struct rtc_wkalrm alm;
|
|
struct rtc_wkalrm alm;
|
|
|
|
|
|
/* Don't show disabled alarms. For uniformity, RTC alarms are
|
|
/* Don't show disabled alarms. For uniformity, RTC alarms are
|
|
@@ -145,8 +146,8 @@ wakealarm_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
*/
|
|
*/
|
|
retval = rtc_read_alarm(to_rtc_device(dev), &alm);
|
|
retval = rtc_read_alarm(to_rtc_device(dev), &alm);
|
|
if (retval == 0 && alm.enabled) {
|
|
if (retval == 0 && alm.enabled) {
|
|
- rtc_tm_to_time(&alm.time, &alarm);
|
|
|
|
- retval = sprintf(buf, "%lu\n", alarm);
|
|
|
|
|
|
+ alarm = rtc_tm_to_time64(&alm.time);
|
|
|
|
+ retval = sprintf(buf, "%lld\n", alarm);
|
|
}
|
|
}
|
|
|
|
|
|
return retval;
|
|
return retval;
|
|
@@ -157,8 +158,8 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
|
|
const char *buf, size_t n)
|
|
const char *buf, size_t n)
|
|
{
|
|
{
|
|
ssize_t retval;
|
|
ssize_t retval;
|
|
- unsigned long now, alarm;
|
|
|
|
- unsigned long push = 0;
|
|
|
|
|
|
+ time64_t now, alarm;
|
|
|
|
+ time64_t push = 0;
|
|
struct rtc_wkalrm alm;
|
|
struct rtc_wkalrm alm;
|
|
struct rtc_device *rtc = to_rtc_device(dev);
|
|
struct rtc_device *rtc = to_rtc_device(dev);
|
|
const char *buf_ptr;
|
|
const char *buf_ptr;
|
|
@@ -170,7 +171,7 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
|
|
retval = rtc_read_time(rtc, &alm.time);
|
|
retval = rtc_read_time(rtc, &alm.time);
|
|
if (retval < 0)
|
|
if (retval < 0)
|
|
return retval;
|
|
return retval;
|
|
- rtc_tm_to_time(&alm.time, &now);
|
|
|
|
|
|
+ now = rtc_tm_to_time64(&alm.time);
|
|
|
|
|
|
buf_ptr = buf;
|
|
buf_ptr = buf;
|
|
if (*buf_ptr == '+') {
|
|
if (*buf_ptr == '+') {
|
|
@@ -181,7 +182,7 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
|
|
} else
|
|
} else
|
|
adjust = 1;
|
|
adjust = 1;
|
|
}
|
|
}
|
|
- retval = kstrtoul(buf_ptr, 0, &alarm);
|
|
|
|
|
|
+ retval = kstrtos64(buf_ptr, 0, &alarm);
|
|
if (retval)
|
|
if (retval)
|
|
return retval;
|
|
return retval;
|
|
if (adjust) {
|
|
if (adjust) {
|
|
@@ -197,7 +198,7 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
|
|
return retval;
|
|
return retval;
|
|
if (alm.enabled) {
|
|
if (alm.enabled) {
|
|
if (push) {
|
|
if (push) {
|
|
- rtc_tm_to_time(&alm.time, &push);
|
|
|
|
|
|
+ push = rtc_tm_to_time64(&alm.time);
|
|
alarm += push;
|
|
alarm += push;
|
|
} else
|
|
} else
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
@@ -212,7 +213,7 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
|
|
*/
|
|
*/
|
|
alarm = now + 300;
|
|
alarm = now + 300;
|
|
}
|
|
}
|
|
- rtc_time_to_tm(alarm, &alm.time);
|
|
|
|
|
|
+ rtc_time64_to_tm(alarm, &alm.time);
|
|
|
|
|
|
retval = rtc_set_alarm(rtc, &alm);
|
|
retval = rtc_set_alarm(rtc, &alm);
|
|
return (retval < 0) ? retval : n;
|
|
return (retval < 0) ? retval : n;
|