mmc: sunplus: Fix platform_get_irq() error checking
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Wed, 9 Aug 2023 07:18:12 +0000 (00:18 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 9 Aug 2023 13:40:52 +0000 (15:40 +0200)
The platform_get_irq() function returns negative error codes on failure.

Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20230809071812.547229-2-harshit.m.mogalapalli@oracle.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sunplus-mmc.c

index 2bdebeb..e9cb1a5 100644 (file)
@@ -885,7 +885,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)
                return dev_err_probe(&pdev->dev, PTR_ERR(host->rstc), "rst get fail\n");
 
        host->irq = platform_get_irq(pdev, 0);
-       if (host->irq <= 0)
+       if (host->irq < 0)
                return host->irq;
 
        ret = devm_request_threaded_irq(&pdev->dev, host->irq,