Re: [PATCH] can: flexcan: honor Device Tree alias for CAN netdev index
From: Marc Kleine-Budde
Date: Thu Jul 30 2026 - 08:37:16 EST
On 30.07.2026 14:24:16, Michel Alex wrote:
> The FlexCAN driver currently relies on dynamic netdev numbering when
> registering CAN interfaces. This makes board-level name assignment
> difficult when users want stable or swapped interface names (for example,
> mapping physical CAN1 to can0 and CAN0 to can1).
>
> Read the DT alias ID with of_alias_get_id(np, "can") during probe and,
> when present, pre-set the netdev name to can%d before
> register_candev(). This lets the existing Linux alias mechanism drive
> the final interface name.
>
> With this change, systems can control naming from DT aliases, while
> keeping existing behavior unchanged when no CAN alias is provided.
NAK, please use udev/systemd/... to give networking devices stables names.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature