mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2 v2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking
@ 2017-11-18  9:10 Arvind Yadav
  2017-11-18  9:10 ` [PATCH 2/2 v2] misc: atmel-ssc: " Arvind Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-11-18  9:10 UTC (permalink / raw)
  To: arnd, gregkh, joel, nicolas.ferre, alexandre.belloni, linux
  Cc: linux-kernel, linux-arm-kernel

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 <arvind.yadav.cs@gmail.com>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid.

 drivers/misc/aspeed-lpc-snoop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/aspeed-lpc-snoop.c b/drivers/misc/aspeed-lpc-snoop.c
index cb78c98..14c3c90 100644
--- a/drivers/misc/aspeed-lpc-snoop.c
+++ b/drivers/misc/aspeed-lpc-snoop.c
@@ -115,8 +115,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
 	int rc;
 
 	lpc_snoop->irq = platform_get_irq(pdev, 0);
-	if (!lpc_snoop->irq)
-		return -ENODEV;
+	if (lpc_snoop->irq <= 0)
+		return lpc_snoop->irq;
 
 	rc = devm_request_irq(dev, lpc_snoop->irq,
 			      aspeed_lpc_snoop_irq, IRQF_SHARED,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-20  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18  9:10 [PATCH 1/2 v2] misc: aspeed-lpc-snoop: Fix platform_get_irq's error checking Arvind Yadav
2017-11-18  9:10 ` [PATCH 2/2 v2] misc: atmel-ssc: " Arvind Yadav
2017-11-20  9:06   ` Nicolas Ferre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®