lkml.org 
[lkml]   [2017]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/6] mmc: s3cmci: 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/mmc/host/s3cmci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index f7f157a..cc801bc 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -1658,9 +1658,9 @@ static int s3cmci_probe(struct platform_device *pdev)
}

host->irq = platform_get_irq(pdev, 0);
- if (host->irq == 0) {
+ if (host->irq < 0) {
dev_err(&pdev->dev, "failed to get interrupt resource.\n");
- ret = -EINVAL;
+ ret = host->irq;
goto probe_iounmap;
}

--
2.7.4
\
 
 \ /
  Last update: 2017-11-17 21:31    [W:0.136 / U:1.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site