From: Chaosheng Qu <redacted>
This is a robustness and consistency cleanup, this issue has not been seen
on real hardware.
sun4ican_probe() collapses every failure of platform_get_irq() into
-ENODEV:
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
err = -ENODEV;
goto exit_put_clk;
}
The driver matches through an of_match_table, so of_irq_get() returns
EPROBE_DEFER while the interrupt controller has not been probed. The
probe overwrites it and the driver core stops retrying, leaving the
device unbound even though the interrupt controller appears later.
Return the lookup error unchanged, which is what the neighbouring CAN
platform drivers do, e.g. commit ("can: cc770: don't discard the IRQ lookup
error in probe").
A device tree without an interrupt now reports -ENXIO rather than
-ENODEV; the driver core treats both as a failed probe.
Build tested on x86_64.
Signed-off-by: Chaosheng Qu <redacted>
Link: https://patch.msgid.link/2a7cb6e4e1b494efd4da512abbf307c19d9d1467.1792118040.git.chaosheng.qu.linux@gmail.com (local)
[mkl: update patch description]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/sun4i_can.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
index 2a169dbf7813..7765f4ef6ac8 100644
--- a/drivers/net/can/sun4i_can.c
+++ b/drivers/net/can/sun4i_can.c
@@ -852,7 +852,7 @@ static int sun4ican_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
- err = -ENODEV;
+ err = irq;
goto exit;
}
--
2.53.0