Skip to content

can: fix probing and use of device_get_match_data()

Marc Kleine-Budde linux-arm-kernel linux-can linux-renesas-soc lkml sashiko-reviews stable 1 version In review

Get series with b4
b4 am 20261114-fix-device_get_match_data-v1-0-2d82025e9646@pengutronix.de change-id 20261114-fix-device_get_match_data-11dc9cd85ec7

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4can: c_can: c_can_plat_probe(): reject devices without match datadrivers/net/can/c_can/c_can_platform.c+2 -02 replies
2/4can: flexcan: flexcan_probe(): fix probing for m68k/coldfire and reject devices without match datadrivers/net/can/flexcan/flexcan-core.c+5 -02 replies
3/4can: xilinx_can: xcan_probe(): reject devices without match datadrivers/net/can/xilinx_can.c+2 -01 reply
4/4can: rcar_canfd: rcar_canfd_probe(): reject devices without match datadrivers/net/can/rcar/rcar_canfd.c+2 -07 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchMichal Simek
1/4
2/4
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH can 0/4] can: fix probing and use of device_get_match_data()

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.

---
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,

Signature · 1 line
Marc Kleine-Budde <[email protected]>