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...@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

Reply via email to