diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-01-06 17:42:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:23 -0500 |
commit | 2fac6674ddf3164da42a76d62f8912073d629a30 (patch) | |
tree | ffc7b69bbbe065ebe1e75be601c866467252f550 /drivers/rtc/rtc-twl4030.c | |
parent | d4afc76c0b59a37113e184004f8a9989cfc1ddd3 (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-twl4030.c')
-rw-r--r-- | drivers/rtc/rtc-twl4030.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c index 01d8da9afdc8..8ce5f74ee45b 100644 --- a/drivers/rtc/rtc-twl4030.c +++ b/drivers/rtc/rtc-twl4030.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/errno.h> | ||
22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
23 | #include <linux/module.h> | 24 | #include <linux/module.h> |
24 | #include <linux/types.h> | 25 | #include <linux/types.h> |
@@ -415,8 +416,8 @@ static int __devinit twl4030_rtc_probe(struct platform_device *pdev) | |||
415 | int irq = platform_get_irq(pdev, 0); | 416 | int irq = platform_get_irq(pdev, 0); |
416 | u8 rd_reg; | 417 | u8 rd_reg; |
417 | 418 | ||
418 | if (irq < 0) | 419 | if (irq <= 0) |
419 | return irq; | 420 | return -EINVAL; |
420 | 421 | ||
421 | rtc = rtc_device_register(pdev->name, | 422 | rtc = rtc_device_register(pdev->name, |
422 | &pdev->dev, &twl4030_rtc_ops, THIS_MODULE); | 423 | &pdev->dev, &twl4030_rtc_ops, THIS_MODULE); |