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:
committed by
Linus Torvalds
parent
d4afc76c0b
commit
2fac6674dd
@@ -205,7 +205,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *regs;
|
||||
struct rtc_at32ap700x *rtc;
|
||||
int irq = -1;
|
||||
int irq;
|
||||
int ret;
|
||||
|
||||
rtc = kzalloc(sizeof(struct rtc_at32ap700x), GFP_KERNEL);
|
||||
@@ -222,7 +222,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0) {
|
||||
if (irq <= 0) {
|
||||
dev_dbg(&pdev->dev, "could not get irq\n");
|
||||
ret = -ENXIO;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user