aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-vr41xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-vr41xx.c')
-rw-r--r--drivers/rtc/rtc-vr41xx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 57b7aac092a3..f11297aff854 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -27,6 +27,7 @@
27#include <linux/rtc.h> 27#include <linux/rtc.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29#include <linux/types.h> 29#include <linux/types.h>
30#include <linux/log2.h>
30 31
31#include <asm/div64.h> 32#include <asm/div64.h>
32#include <asm/io.h> 33#include <asm/io.h>
@@ -210,6 +211,8 @@ static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq)
210{ 211{
211 unsigned long count; 212 unsigned long count;
212 213
214 if (!is_power_of_2(freq))
215 return -EINVAL;
213 count = RTC_FREQUENCY; 216 count = RTC_FREQUENCY;
214 do_div(count, freq); 217 do_div(count, freq);
215 218