[PATCH can 0/4] can: fix probing and use of device_get_match_data()
From: Marc Kleine-Budde
Date: Sat Nov 14 2026 - 07:57:40 EST
With patch 5e6c3454b405 ("net: can: Use device_get_match_data()") several
CAN drivers were converted to device_get_match_data(). The author assumed
that error checking for matching and match data is not necessary.
This misses the fact that that drivers on the platform bus can forcefully
bound using driver_override and device_get_match_data() will return NULL.
By using device_get_match_data(), this change broke probing for
m68k/coldfire, which still uses platform devices.
This series adds missing NULL pointer checks and fixes probing for the
flexcan on m68k/coldfire.
Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
---
Marc Kleine-Budde (4):
can: c_can: c_can_plat_probe(): reject devices without match data
can: flexcan: flexcan_probe(): fix probing for m68k/coldfire and reject devices without match data
can: xilinx_can: xcan_probe(): reject devices without match data
can: rcar_canfd: rcar_canfd_probe(): reject devices without match data
drivers/net/can/c_can/c_can_platform.c | 2 ++
drivers/net/can/flexcan/flexcan-core.c | 5 +++++
drivers/net/can/rcar/rcar_canfd.c | 2 ++
drivers/net/can/xilinx_can.c | 2 ++
4 files changed, 11 insertions(+)
---
base-commit: ead6fa9a0ab194f02a2f36d634b193e9c5f9a1c6
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git main
change-id: 20261114-fix-device_get_match_data-11dc9cd85ec7
Best regards,
--
Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>