2017-11-23 15:47:31

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH v2] MIPS: ralink: Fix platform_get_irq's error checking

The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2: Subject spelling was not correct. change FIX in place
of 'ix'.

arch/mips/ralink/timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/ralink/timer.c b/arch/mips/ralink/timer.c
index d4469b2..913dc84b 100644
--- a/arch/mips/ralink/timer.c
+++ b/arch/mips/ralink/timer.c
@@ -109,7 +109,7 @@ static int rt_timer_probe(struct platform_device *pdev)
}

rt->irq = platform_get_irq(pdev, 0);
- if (!rt->irq) {
+ if (rt->irq < 0) {
dev_err(&pdev->dev, "failed to load irq\n");
return -ENOENT;
}
--
2.7.4


From 1586263558283258911@xxx Sat Dec 09 00:20:14 +0000 2017
X-GM-THRID: 1579806959198095769
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread