Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH can 0/4] can: fix probing and use of device_get_match_data()
@ 2026-11-14 12:56 Marc Kleine-Budde
  2026-11-14 12:56 ` [PATCH can 1/4] can: c_can: c_can_plat_probe(): reject devices without match data Marc Kleine-Budde
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Marc Kleine-Budde @ 2026-11-14 12:56 UTC (permalink / raw)
  To: Vincent Mailhol, Rob Herring, Harini T, Michal Simek,
	Geert Uytterhoeven, Magnus Damm
  Cc: kernel, linux-can, linux-kernel, linux-arm-kernel,
	linux-renesas-soc, Marc Kleine-Budde, stable,
	Uwe Kleine-König

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@pengutronix.de>
---
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@pengutronix.de>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-14 13:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14 12:56 [PATCH can 0/4] can: fix probing and use of device_get_match_data() Marc Kleine-Budde
2026-11-14 12:56 ` [PATCH can 1/4] can: c_can: c_can_plat_probe(): reject devices without match data Marc Kleine-Budde
2026-11-14 13:33   ` sashiko-bot
2026-11-14 12:56 ` [PATCH can 2/4] can: flexcan: flexcan_probe(): fix probing for m68k/coldfire and " Marc Kleine-Budde
2026-11-14 13:03   ` sashiko-bot
2026-11-14 12:56 ` [PATCH can 3/4] can: xilinx_can: xcan_probe(): " Marc Kleine-Budde
2026-11-14 12:56 ` [PATCH can 4/4] can: rcar_canfd: rcar_canfd_probe(): " Marc Kleine-Budde
2026-11-14 13:03   ` sashiko-bot
2026-11-14 13:09     ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox