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 :
Add failure case '<= 0' instead of '< 0'. If IRQ0 is not valid.
changes in v3 :
return -EINVAL insted of irq.
drivers/mfd/ipaq-micro.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index cd762d0..176cf65 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -410,7 +410,7 @@ static int __init micro_probe(struct platform_device *pdev)
micro_reset_comm(micro);
irq = platform_get_irq(pdev, 0);
- if (!irq)
+ if (irq <= 0)
return -EINVAL;
ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr,
IRQF_SHARED, "ipaq-micro",
--
2.7.4
From 1584396058300207787@xxx Sat Nov 18 09:37:07 +0000 2017
X-GM-THRID: 1584396058300207787
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread