diff options
Diffstat (limited to 'drivers/rtc/rtc-vr41xx.c')
-rw-r--r-- | drivers/rtc/rtc-vr41xx.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c index 277596c302e3..596764fd29f5 100644 --- a/drivers/rtc/rtc-vr41xx.c +++ b/drivers/rtc/rtc-vr41xx.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <asm/div64.h> | 30 | #include <asm/div64.h> |
31 | #include <asm/io.h> | 31 | #include <asm/io.h> |
32 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
33 | #include <asm/vr41xx/vr41xx.h> | 33 | #include <asm/vr41xx/irq.h> |
34 | 34 | ||
35 | MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); | 35 | MODULE_AUTHOR("Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>"); |
36 | MODULE_DESCRIPTION("NEC VR4100 series RTC driver"); | 36 | MODULE_DESCRIPTION("NEC VR4100 series RTC driver"); |
@@ -81,7 +81,6 @@ MODULE_LICENSE("GPL"); | |||
81 | 81 | ||
82 | #define RTC_FREQUENCY 32768 | 82 | #define RTC_FREQUENCY 32768 |
83 | #define MAX_PERIODIC_RATE 6553 | 83 | #define MAX_PERIODIC_RATE 6553 |
84 | #define MAX_USER_PERIODIC_RATE 64 | ||
85 | 84 | ||
86 | static void __iomem *rtc1_base; | 85 | static void __iomem *rtc1_base; |
87 | static void __iomem *rtc2_base; | 86 | static void __iomem *rtc2_base; |
@@ -94,7 +93,7 @@ static void __iomem *rtc2_base; | |||
94 | 93 | ||
95 | static unsigned long epoch = 1970; /* Jan 1 1970 00:00:00 */ | 94 | static unsigned long epoch = 1970; /* Jan 1 1970 00:00:00 */ |
96 | 95 | ||
97 | static spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; | 96 | static DEFINE_SPINLOCK(rtc_lock); |
98 | static char rtc_name[] = "RTC"; | 97 | static char rtc_name[] = "RTC"; |
99 | static unsigned long periodic_frequency; | 98 | static unsigned long periodic_frequency; |
100 | static unsigned long periodic_count; | 99 | static unsigned long periodic_count; |
@@ -240,9 +239,6 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long | |||
240 | if (arg > MAX_PERIODIC_RATE) | 239 | if (arg > MAX_PERIODIC_RATE) |
241 | return -EINVAL; | 240 | return -EINVAL; |
242 | 241 | ||
243 | if (arg > MAX_USER_PERIODIC_RATE && capable(CAP_SYS_RESOURCE) == 0) | ||
244 | return -EACCES; | ||
245 | |||
246 | periodic_frequency = arg; | 242 | periodic_frequency = arg; |
247 | 243 | ||
248 | count = RTC_FREQUENCY; | 244 | count = RTC_FREQUENCY; |
@@ -263,10 +259,6 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long | |||
263 | /* Doesn't support before 1900 */ | 259 | /* Doesn't support before 1900 */ |
264 | if (arg < 1900) | 260 | if (arg < 1900) |
265 | return -EINVAL; | 261 | return -EINVAL; |
266 | |||
267 | if (capable(CAP_SYS_TIME) == 0) | ||
268 | return -EACCES; | ||
269 | |||
270 | epoch = arg; | 262 | epoch = arg; |
271 | break; | 263 | break; |
272 | default: | 264 | default: |
@@ -353,11 +345,11 @@ static int __devinit rtc_probe(struct platform_device *pdev) | |||
353 | spin_unlock_irq(&rtc_lock); | 345 | spin_unlock_irq(&rtc_lock); |
354 | 346 | ||
355 | irq = ELAPSEDTIME_IRQ; | 347 | irq = ELAPSEDTIME_IRQ; |
356 | retval = request_irq(irq, elapsedtime_interrupt, SA_INTERRUPT, | 348 | retval = request_irq(irq, elapsedtime_interrupt, IRQF_DISABLED, |
357 | "elapsed_time", pdev); | 349 | "elapsed_time", pdev); |
358 | if (retval == 0) { | 350 | if (retval == 0) { |
359 | irq = RTCLONG1_IRQ; | 351 | irq = RTCLONG1_IRQ; |
360 | retval = request_irq(irq, rtclong1_interrupt, SA_INTERRUPT, | 352 | retval = request_irq(irq, rtclong1_interrupt, IRQF_DISABLED, |
361 | "rtclong1", pdev); | 353 | "rtclong1", pdev); |
362 | } | 354 | } |
363 | 355 | ||