From 545017832a20abab394937baa702b03796611e3c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 22 Jul 2011 09:12:51 +0000 Subject: [PATCH] --- yaml --- r: 263054 b: refs/heads/master c: 6e7a333eaa522ef73be01caec7a01521490aaf00 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/rtc/interface.c | 2 +- trunk/include/linux/rtc.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index bc1e16bda3b7..1616f0bed84b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3c8bb90efb6e3105206e4aaa9127395feeda5492 +refs/heads/master: 6e7a333eaa522ef73be01caec7a01521490aaf00 diff --git a/trunk/drivers/rtc/interface.c b/trunk/drivers/rtc/interface.c index a1ba2caa8308..44e91e598f8d 100644 --- a/trunk/drivers/rtc/interface.c +++ b/trunk/drivers/rtc/interface.c @@ -708,7 +708,7 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq) int err = 0; unsigned long flags; - if (freq <= 0) + if (freq <= 0 || freq > RTC_MAX_FREQ) return -EINVAL; retry: spin_lock_irqsave(&rtc->irq_task_lock, flags); diff --git a/trunk/include/linux/rtc.h b/trunk/include/linux/rtc.h index b27ebea25660..93f4d035076b 100644 --- a/trunk/include/linux/rtc.h +++ b/trunk/include/linux/rtc.h @@ -97,6 +97,9 @@ struct rtc_pll_info { #define RTC_AF 0x20 /* Alarm interrupt */ #define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ + +#define RTC_MAX_FREQ 8192 + #ifdef __KERNEL__ #include