Re: [PATCH net-next 08/12] can: janz-ican3: don't discard the IRQ lookup error in probe

From
netdev-bot+sashiko@kernel.org
Date
2026-11-19 09:54:32
Also in
linux-can
Reply to
Marc Kleine-Budde, 2026-11-18
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message doesn't say what users will see after the
  change, and the one failure that can actually happen is now reported…

--

can: janz-ican3: don't discard the IRQ lookup error in probe

This commit changes ican3_probe() to return the error from
platform_get_irq() as is, instead of always returning -ENODEV. The commit
message says the driver is an MFD child of janz-cmodio, cannot see
-EPROBE_DEFER, and should not invent its own error code.

Link: https://patch.msgid.link/28add8d0570b72d35c65c19b2365007cf0aa15c3.1792118040.git.chaosheng.qu.linux@gmail.com (local)
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 1efdd1fd8caa4..a65326b0f11e9 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1944,7 +1944,7 @@ static int ican3_probe(struct platform_device *pdev)
 	/* find our IRQ number */
 	mod->irq = platform_get_irq(pdev, 0);
 	if (mod->irq < 0) {
-		ret = -ENODEV;
+		ret = mod->irq;
 		goto out_free_ndev;
 	}
[Severity: Low]
This isn't a bug, but could the commit message name the failure that can
actually happen here, and the new error code it produces?

The message says:

  The probe should not invent an error code for a lookup that failed for
  another reason.

cmodio_setup_subdevice() in drivers/mfd/janz-cmodio.c always gives each
child a single IRQ resource at offset 0:

	res->flags = IORESOURCE_IRQ;
	res->parent = NULL;
	res->start = 0;
	res->end = 0;

cmodio_probe_submodules() then passes the carrier PCI device's irq as
irq_base:

	return mfd_add_devices(&pdev->dev, 0, priv->cells,
			       num_probed, NULL, pdev->irq, NULL);

So the resource is always there, and the child has no OF node. On
non-SPARC systems, the only error platform_get_irq() can return here
appears to come from platform_get_irq_affinity() when the PCI device's
irq is 0:

	if (WARN(!ret, "0 is an invalid IRQ number\n"))
		return -EINVAL;

Before this patch, ican3_probe() turned that into -ENODEV. It now returns
-EINVAL.

In call_driver_probe() in drivers/base/dd.c, -ENODEV and -ENXIO are only
logged with dev_dbg ("rejects match"). -EINVAL goes to the default branch
and gets a dev_err ("probe with driver ... failed with error -22"). A
sysfs bind attempt would also get -EINVAL back instead of -ENODEV. On
SPARC the lookup returns -ENXIO, which is logged the same way as -ENODEV,
so nothing changes there.

The other patches in this series describe the visible change, for
example:

  A device tree without an interrupt now reports -ENXIO rather than
  -ENODEV

Could a similar note be added here, saying that -EINVAL now replaces
-ENODEV when the carrier's irq is 0? The code change itself looks correct.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118092955.1283165-2-mkl%40pengutronix.de
Thread (22 messages) 22 messages, 4 authors, last reply 5d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help