Skip to content

Commit 53b8d2b

Browse files
Ruan Jinjiemarckleinebudde
authored andcommitted
can: flexcan: fix the return value handle for platform_get_irq()
There is no possible for platform_get_irq() to return 0 and the return value of platform_get_irq() is more sensible to show the error reason. Signed-off-by: Ruan Jinjie <[email protected]> Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 2b3082c commit 53b8d2b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/net/can/flexcan/flexcan-core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,8 +2089,8 @@ static int flexcan_probe(struct platform_device *pdev)
20892089
}
20902090

20912091
irq = platform_get_irq(pdev, 0);
2092-
if (irq <= 0)
2093-
return -ENODEV;
2092+
if (irq < 0)
2093+
return irq;
20942094

20952095
regs = devm_platform_ioremap_resource(pdev, 0);
20962096
if (IS_ERR(regs))
@@ -2167,13 +2167,13 @@ static int flexcan_probe(struct platform_device *pdev)
21672167

21682168
if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
21692169
priv->irq_boff = platform_get_irq(pdev, 1);
2170-
if (priv->irq_boff <= 0) {
2171-
err = -ENODEV;
2170+
if (priv->irq_boff < 0) {
2171+
err = priv->irq_boff;
21722172
goto failed_platform_get_irq;
21732173
}
21742174
priv->irq_err = platform_get_irq(pdev, 2);
2175-
if (priv->irq_err <= 0) {
2176-
err = -ENODEV;
2175+
if (priv->irq_err < 0) {
2176+
err = priv->irq_err;
21772177
goto failed_platform_get_irq;
21782178
}
21792179
}

0 commit comments

Comments
 (0)