lkml.org 
[lkml]   [2017]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ipmi: bt-bmc: Fix platform_get_irq's error checking
Date
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>
---
drivers/char/ipmi/bt-bmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 70d434b..7566683 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -410,7 +410,7 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc,
int rc;

bt_bmc->irq = platform_get_irq(pdev, 0);
- if (!bt_bmc->irq)
+ if (bt_bmc->irq < 0)
return -ENODEV;

rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED,
--
2.7.4
\
 
 \ /
  Last update: 2017-11-23 16:47    [W:0.036 / U:10.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site