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-at32ap700x.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-at32ap700x.c')
-rw-r--r-- | drivers/rtc/rtc-at32ap700x.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c index 90b9a6503e15..e1ec33e40e38 100644 --- a/drivers/rtc/rtc-at32ap700x.c +++ b/drivers/rtc/rtc-at32ap700x.c | |||
@@ -205,7 +205,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev) | |||
205 | { | 205 | { |
206 | struct resource *regs; | 206 | struct resource *regs; |
207 | struct rtc_at32ap700x *rtc; | 207 | struct rtc_at32ap700x *rtc; |
208 | int irq = -1; | 208 | int irq; |
209 | int ret; | 209 | int ret; |
210 | 210 | ||
211 | rtc = kzalloc(sizeof(struct rtc_at32ap700x), GFP_KERNEL); | 211 | rtc = kzalloc(sizeof(struct rtc_at32ap700x), GFP_KERNEL); |
@@ -222,7 +222,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | irq = platform_get_irq(pdev, 0); | 224 | irq = platform_get_irq(pdev, 0); |
225 | if (irq < 0) { | 225 | if (irq <= 0) { |
226 | dev_dbg(&pdev->dev, "could not get irq\n"); | 226 | dev_dbg(&pdev->dev, "could not get irq\n"); |
227 | ret = -ENXIO; | 227 | ret = -ENXIO; |
228 | goto out; | 228 | goto out; |