OSDN Git Service

mmc: s3cmci: Fix platform_get_irq's error checking
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sun, 19 Nov 2017 04:52:44 +0000 (10:22 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 15 Dec 2017 08:13:16 +0000 (09:13 +0100)
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>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/s3cmci.c

index f7f157a..36daee1 100644 (file)
@@ -1658,7 +1658,7 @@ 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;
                goto probe_iounmap;