mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Vincent Mailhol <mailhol@kernel.org>,
	Rob Herring <robh@kernel.org>,  Harini T <harini.t@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	 Geert Uytterhoeven <geert+renesas@glider.be>,
	 Magnus Damm <magnus.damm@gmail.com>
Cc: kernel@pengutronix.de, linux-can@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	stable@vger.kernel.org,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Subject: [PATCH can 0/4] can: fix probing and use of device_get_match_data()
Date: Sat, 14 Nov 2026 13:56:13 +0100	[thread overview]
Message-ID: <20261114-fix-device_get_match_data-v1-0-2d82025e9646@pengutronix.de> (raw)

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>


             reply	other threads:[~2026-11-14 12:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 12:56 Marc Kleine-Budde [this message]
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 12:56 ` [PATCH can 2/4] can: flexcan: flexcan_probe(): fix probing for m68k/coldfire and " Marc Kleine-Budde
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261114-fix-device_get_match_data-v1-0-2d82025e9646@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=geert+renesas@glider.be \
    --cc=harini.t@amd.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mailhol@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®