Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29742
b: refs/heads/master
c: 56f10c6
h: refs/heads/master
v: v3
  • Loading branch information
Alessandro Zummo authored and Linus Torvalds committed Jun 25, 2006
1 parent 7bdb751 commit 6abf2bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c0c570576d02000063e28faadcce8c07396755d
refs/heads/master: 56f10c634e145d75e45b56a73f59fb6dff1caa8e
22 changes: 6 additions & 16 deletions trunk/drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ int rtc_irq_set_state(struct class_device *class_dev, struct rtc_task *task, int
unsigned long flags;
struct rtc_device *rtc = to_rtc_device(class_dev);

if (rtc->ops->irq_set_state == NULL)
return -ENXIO;

spin_lock_irqsave(&rtc->irq_task_lock, flags);
if (rtc->irq_task != task)
err = -ENXIO;
Expand All @@ -243,25 +246,12 @@ EXPORT_SYMBOL_GPL(rtc_irq_set_state);

int rtc_irq_set_freq(struct class_device *class_dev, struct rtc_task *task, int freq)
{
int err = 0, tmp = 0;
int err = 0;
unsigned long flags;
struct rtc_device *rtc = to_rtc_device(class_dev);

/* allowed range is 2-8192 */
if (freq < 2 || freq > 8192)
return -EINVAL;
/*
FIXME: this does not belong here, will move where appropriate
at a later stage. It cannot hurt right now, trust me :)
if ((freq > rtc_max_user_freq) && (!capable(CAP_SYS_RESOURCE)))
return -EACCES;
*/
/* check if freq is a power of 2 */
while (freq > (1 << tmp))
tmp++;

if (freq != (1 << tmp))
return -EINVAL;
if (rtc->ops->irq_set_freq == NULL)
return -ENXIO;

spin_lock_irqsave(&rtc->irq_task_lock, flags);
if (rtc->irq_task != task)
Expand Down

0 comments on commit 6abf2bf

Please sign in to comment.