diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-27 10:33:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 11:07:13 +0300 |
commit | 8db94d79456dc2394688aec8f004b7caff0f3e2d (patch) | |
tree | 6ce5e5af55f507325742b05d58e7fbe28b5274b7 /drivers/memory | |
parent | 9bff692ae215408f7ae1462fa7be5d7451e13ee6 (diff) | |
download | linux-8db94d79456dc2394688aec8f004b7caff0f3e2d.tar.xz |
memory: fsl-corenet-cf: Fix handling of platform_get_irq() error
[ Upstream commit dd85345abca60a8916617e8d75c0f9ce334336dd ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/fsl-corenet-cf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-cf.c index 662d050243be..2fbf8d09af36 100644 --- a/drivers/memory/fsl-corenet-cf.c +++ b/drivers/memory/fsl-corenet-cf.c @@ -215,10 +215,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) { |