aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-vr41xx.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-01-06 17:42:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:23 -0500
commit2fac6674ddf3164da42a76d62f8912073d629a30 (patch)
treeffc7b69bbbe065ebe1e75be601c866467252f550 /drivers/rtc/rtc-vr41xx.c
parentd4afc76c0b59a37113e184004f8a9989cfc1ddd3 (diff)
rtc: bunch of drivers: fix 'no irq' case handing
This patch fixes a bunch of irq checking misuses. Most drivers were getting irq via platform_get_irq(), which returns -ENXIO or r->start. rtc-cmos.c is special. It is using PNP and platform bindings. Hopefully nobody is using PNP IRQ 0 for RTC. So the changes should be safe. rtc-sh.c is using platform_get_irq, but was storing a result into an unsigned type, then was checking for < 0. This is fixed now. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-vr41xx.c')
-rw-r--r--drivers/rtc/rtc-vr41xx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 834dcc6d785f..57b7aac092a3 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -84,8 +84,8 @@ static DEFINE_SPINLOCK(rtc_lock);
84static char rtc_name[] = "RTC"; 84static char rtc_name[] = "RTC";
85static unsigned long periodic_count; 85static unsigned long periodic_count;
86static unsigned int alarm_enabled; 86static unsigned int alarm_enabled;
87static int aie_irq = -1; 87static int aie_irq;
88static int pie_irq = -1; 88static int pie_irq;
89 89
90static inline unsigned long read_elapsed_second(void) 90static inline unsigned long read_elapsed_second(void)
91{ 91{
@@ -360,7 +360,7 @@ static int __devinit rtc_probe(struct platform_device *pdev)
360 spin_unlock_irq(&rtc_lock); 360 spin_unlock_irq(&rtc_lock);
361 361
362 aie_irq = platform_get_irq(pdev, 0); 362 aie_irq = platform_get_irq(pdev, 0);
363 if (aie_irq < 0 || aie_irq >= nr_irqs) { 363 if (aie_irq <= 0) {
364 retval = -EBUSY; 364 retval = -EBUSY;
365 goto err_device_unregister; 365 goto err_device_unregister;
366 } 366 }
@@ -371,7 +371,7 @@ static int __devinit rtc_probe(struct platform_device *pdev)
371 goto err_device_unregister; 371 goto err_device_unregister;
372 372
373 pie_irq = platform_get_irq(pdev, 1); 373 pie_irq = platform_get_irq(pdev, 1);
374 if (pie_irq < 0 || pie_irq >= nr_irqs) 374 if (pie_irq <= 0)
375 goto err_free_irq; 375 goto err_free_irq;
376 376
377 retval = request_irq(pie_irq, rtclong1_interrupt, IRQF_DISABLED, 377 retval = request_irq(pie_irq, rtclong1_interrupt, IRQF_DISABLED,