Thread (26 messages) 26 messages, 3 authors, 20d ago

[PATCH net 08/22] can: cc770: platform_get_irq(): propagate the error

flat view
COLD20d

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2026-09-28 19:33:26
Also in: linux-can
Subsystem: can network drivers, the rest · Maintainers: Marc Kleine-Budde, Vincent Mailhol, Linus Torvalds

From: Quchaosheng <redacted>

cc770_platform_probe() turns every failure of platform_get_irq() into
-ENODEV, including -EPROBE_DEFER. Return the error unchanged so that a
deferred probe stays deferred, and keep -ENODEV for the case where no
interrupt is described at all.

The memory resource is checked separately for the same reason, so that a
missing resource is still reported as -ENODEV rather than being confused
with an interrupt lookup failure.

The same pattern is used by other CAN platform drivers, such as
c_can_platform.c and flexcan-core.c.

Signed-off-by: Quchaosheng <redacted>
Link: https://patch.msgid.link/20260914055611.495105-1-quchaosheng000406@163.com (local)
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/cc770/cc770_platform.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/cc770/cc770_platform.c b/drivers/net/can/cc770/cc770_platform.c
index b6c4f02ffb97..ac218acedb10 100644
--- a/drivers/net/can/cc770/cc770_platform.c
+++ b/drivers/net/can/cc770/cc770_platform.c
@@ -156,8 +156,13 @@ static int cc770_platform_probe(struct platform_device *pdev)
 	int err, irq;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!mem)
+		return -ENODEV;
+
 	irq = platform_get_irq(pdev, 0);
-	if (!mem || irq <= 0)
+	if (irq < 0)
+		return irq;
+	if (!irq)
 		return -ENODEV;
 
 	mem_size = resource_size(mem);
-- 
2.53.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help