summaryrefslogtreecommitdiff
path: root/drivers/memory
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-27 09:33:15 +0200
committerKrzysztof Kozlowski <krzk@kernel.org>2020-09-02 17:32:02 +0200
commitdd85345abca60a8916617e8d75c0f9ce334336dd (patch)
treeeed5d2e1ae44d86f10453dc71104f6eed80d4dbe /drivers/memory
parent6cf238d4e21bc21bc18d126358dd617b2c991d66 (diff)
memory: fsl-corenet-cf: Fix handling of platform_get_irq() error
platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: 54afbec0d57f ("memory: Freescale CoreNet Coherency Fabric error reporting driver") Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200827073315.29351-1-krzk@kernel.org
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/fsl-corenet-cf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-cf.c
index 0b0ed72016da..0309bd5a1800 100644
--- a/drivers/memory/fsl-corenet-cf.c
+++ b/drivers/memory/fsl-corenet-cf.c
@@ -211,10 +211,8 @@ static int ccf_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, ccf);
irq = platform_get_irq(pdev, 0);
- if (!irq) {
- dev_err(&pdev->dev, "%s: no irq\n", __func__);
- return -ENXIO;
- }
+ if (irq < 0)
+ return irq;
ret = devm_request_irq(&pdev->dev, irq, ccf_irq, 0, pdev->name, ccf);
if (ret) {