Skip to contentSkip to conversation

memory: fsl-corenet-cf: Fix handling of platform_get_irq() error

PATCH Applied Krzysztof Kozlowski 1 participant 2 messages Aug 27, 2020 – Sep 2, 2020 Memory controller drivers

lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 drivers/memory/fsl-corenet-cf.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/memory/fsl-corenet-cf.c +2 -4
index 0b0ed72016da..0309bd5a1800 100644
@@ -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) {
Signature · 1 line
2.17.1
author maintainer Applied
#1 lore raw
Quoted 7 lines · Krzysztof Kozlowski

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")
---
 drivers/memory/fsl-corenet-cf.c | 6 ++----

Applied.

Best regards,
Krzysztof