Skip to content

Commit dd85345

Browse files
committed
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: 54afbec ("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
1 parent 6cf238d commit dd85345

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/memory/fsl-corenet-cf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ static int ccf_probe(struct platform_device *pdev)
211211
dev_set_drvdata(&pdev->dev, ccf);
212212

213213
irq = platform_get_irq(pdev, 0);
214-
if (!irq) {
215-
dev_err(&pdev->dev, "%s: no irq\n", __func__);
216-
return -ENXIO;
217-
}
214+
if (irq < 0)
215+
return irq;
218216

219217
ret = devm_request_irq(&pdev->dev, irq, ccf_irq, 0, pdev->name, ccf);
220218
if (ret) {

0 commit comments

Comments
 (0)