aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sa1100.c
diff options
context:
space:
mode:
authorAlessandro Zummo <alessandro.zummo@towertech.it>2006-06-25 08:48:20 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:14 -0400
commit110d693d5898649da606cd6e5f6af4d7f70a405f (patch)
treea46b06a383d8a9eda59d7c7e17e8694798769800 /drivers/rtc/rtc-sa1100.c
parent56f10c634e145d75e45b56a73f59fb6dff1caa8e (diff)
[PATCH] rtc subsystem: add capability checks
Centralize CAP_SYS_XXX checks to avoid duplicate code and missing checks in the drivers. Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/rtc/rtc-sa1100.c')
-rw-r--r--drivers/rtc/rtc-sa1100.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index a997529f892..ab486fbc828 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -229,8 +229,6 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
229 spin_unlock_irq(&sa1100_rtc_lock); 229 spin_unlock_irq(&sa1100_rtc_lock);
230 return 0; 230 return 0;
231 case RTC_PIE_ON: 231 case RTC_PIE_ON:
232 if ((rtc_freq > 64) && !capable(CAP_SYS_RESOURCE))
233 return -EACCES;
234 spin_lock_irq(&sa1100_rtc_lock); 232 spin_lock_irq(&sa1100_rtc_lock);
235 OSMR1 = TIMER_FREQ/rtc_freq + OSCR; 233 OSMR1 = TIMER_FREQ/rtc_freq + OSCR;
236 OIER |= OIER_E1; 234 OIER |= OIER_E1;
@@ -242,8 +240,6 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd,
242 case RTC_IRQP_SET: 240 case RTC_IRQP_SET:
243 if (arg < 1 || arg > TIMER_FREQ) 241 if (arg < 1 || arg > TIMER_FREQ)
244 return -EINVAL; 242 return -EINVAL;
245 if ((arg > 64) && (!capable(CAP_SYS_RESOURCE)))
246 return -EACCES;
247 rtc_freq = arg; 243 rtc_freq = arg;
248 return 0; 244 return 0;
249 } 245 }