summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/sysfs.c')
-rw-r--r--drivers/rtc/sysfs.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/rtc/sysfs.c b/drivers/rtc/sysfs.c
index 0d3dac557df5..be3531e7f868 100644
--- a/drivers/rtc/sysfs.c
+++ b/drivers/rtc/sysfs.c
@@ -11,7 +11,6 @@
11 11
12#include "rtc-core.h" 12#include "rtc-core.h"
13 13
14
15/* device attributes */ 14/* device attributes */
16 15
17/* 16/*
@@ -83,7 +82,7 @@ max_user_freq_show(struct device *dev, struct device_attribute *attr, char *buf)
83 82
84static ssize_t 83static ssize_t
85max_user_freq_store(struct device *dev, struct device_attribute *attr, 84max_user_freq_store(struct device *dev, struct device_attribute *attr,
86 const char *buf, size_t n) 85 const char *buf, size_t n)
87{ 86{
88 struct rtc_device *rtc = to_rtc_device(dev); 87 struct rtc_device *rtc = to_rtc_device(dev);
89 unsigned long val; 88 unsigned long val;
@@ -113,12 +112,11 @@ hctosys_show(struct device *dev, struct device_attribute *attr, char *buf)
113{ 112{
114#ifdef CONFIG_RTC_HCTOSYS_DEVICE 113#ifdef CONFIG_RTC_HCTOSYS_DEVICE
115 if (rtc_hctosys_ret == 0 && 114 if (rtc_hctosys_ret == 0 &&
116 strcmp(dev_name(&to_rtc_device(dev)->dev), 115 strcmp(dev_name(&to_rtc_device(dev)->dev),
117 CONFIG_RTC_HCTOSYS_DEVICE) == 0) 116 CONFIG_RTC_HCTOSYS_DEVICE) == 0)
118 return sprintf(buf, "1\n"); 117 return sprintf(buf, "1\n");
119 else
120#endif 118#endif
121 return sprintf(buf, "0\n"); 119 return sprintf(buf, "0\n");
122} 120}
123static DEVICE_ATTR_RO(hctosys); 121static DEVICE_ATTR_RO(hctosys);
124 122
@@ -172,15 +170,15 @@ wakealarm_store(struct device *dev, struct device_attribute *attr,
172 if (*buf_ptr == '=') { 170 if (*buf_ptr == '=') {
173 buf_ptr++; 171 buf_ptr++;
174 push = 1; 172 push = 1;
175 } else 173 } else {
176 adjust = 1; 174 adjust = 1;
175 }
177 } 176 }
178 retval = kstrtos64(buf_ptr, 0, &alarm); 177 retval = kstrtos64(buf_ptr, 0, &alarm);
179 if (retval) 178 if (retval)
180 return retval; 179 return retval;
181 if (adjust) { 180 if (adjust)
182 alarm += now; 181 alarm += now;
183 }
184 if (alarm > now || push) { 182 if (alarm > now || push) {
185 /* Avoid accidentally clobbering active alarms; we can't 183 /* Avoid accidentally clobbering active alarms; we can't
186 * entirely prevent that here, without even the minimal 184 * entirely prevent that here, without even the minimal