Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126365
b: refs/heads/master
c: 5d2a503
h: refs/heads/master
i:
  126363: 307a4a6
v: v3
  • Loading branch information
Jonathan Cameron authored and Linus Torvalds committed Jan 6, 2009
1 parent 8e4e7b3 commit b7291b1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 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: 2fac6674ddf3164da42a76d62f8912073d629a30
refs/heads/master: 5d2a50371ddf127afa782ad3147469be8e9bd69f
3 changes: 0 additions & 3 deletions trunk/drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,6 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq)
if (rtc->ops->irq_set_freq == NULL)
return -ENXIO;

if (!is_power_of_2(freq))
return -EINVAL;

spin_lock_irqsave(&rtc->irq_task_lock, flags);
if (rtc->irq_task != NULL && task == NULL)
err = -EBUSY;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>
#include <linux/log2.h>

/* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */
#include <asm-generic/rtc.h>
Expand Down Expand Up @@ -384,6 +385,8 @@ static int cmos_irq_set_freq(struct device *dev, int freq)
if (!is_valid_irq(cmos->irq))
return -ENXIO;

if (!is_power_of_2(freq))
return -EINVAL;
/* 0 = no irqs; 1 = 2^15 Hz ... 15 = 2^0 Hz */
f = ffs(freq);
if (f-- > 16)
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ static int s3c_rtc_setfreq(struct device *dev, int freq)
{
unsigned int tmp;

if (!is_power_of_2(freq))
return -EINVAL;

spin_lock_irq(&s3c_rtc_pie_lock);

tmp = readb(s3c_rtc_base + S3C2410_TICNT) & S3C2410_TICNT_ENABLE;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/rtc/rtc-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/io.h>
#include <linux/log2.h>
#include <asm/rtc.h>

#define DRV_NAME "sh-rtc"
Expand Down Expand Up @@ -551,6 +552,8 @@ static int sh_rtc_irq_set_state(struct device *dev, int enabled)

static int sh_rtc_irq_set_freq(struct device *dev, int freq)
{
if (!is_power_of_2(freq))
return -EINVAL;
return sh_rtc_ioctl(dev, RTC_IRQP_SET, freq);
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/rtc/rtc-vr41xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/rtc.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/log2.h>

#include <asm/div64.h>
#include <asm/io.h>
Expand Down Expand Up @@ -210,6 +211,8 @@ static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq)
{
unsigned long count;

if (!is_power_of_2(freq))
return -EINVAL;
count = RTC_FREQUENCY;
do_div(count, freq);

Expand Down

0 comments on commit b7291b1

Please sign in to comment.