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>
This commit is contained in:
Anton Vorontsov
2009-01-06 14:42:11 -08:00
committed by Linus Torvalds
parent d4afc76c0b
commit 2fac6674dd
9 changed files with 40 additions and 40 deletions

View File

@@ -58,7 +58,7 @@ struct cmos_rtc {
};
/* both platform and pnp busses use negative numbers for invalid irqs */
#define is_valid_irq(n) ((n) >= 0)
#define is_valid_irq(n) ((n) > 0)
static const char driver_name[] = "rtc_cmos";