Re: [PATCH] can: flexcan: honor Device Tree alias for CAN netdev index

Marc Kleine-Budde <[email protected]> Thu, 30 Jul 2026 14:34:29 +0200
Newsgroups org.kernel.vger.linux-can,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
--ph4iustrdthgx54c
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: [PATCH] can: flexcan: honor Device Tree alias for CAN netdev
 index
MIME-Version: 1.0

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

--=20
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung N=C3=BCrnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

--ph4iustrdthgx54c
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQSl+MghEFFAdY3pYJLMOmT6rpmt0gUCamtE0wAKCRDMOmT6rpmt
0m6VAPoDOxPQYxt1IPpOtFea13IpYnLmMUQ0q6pIQRNmQx7sVgD9Hs5sr8Pc/gmR
mBaoIw9aNaQ3pMqq0QunXsYX6n/BgwQ=
=+8Ll
-----END PGP SIGNATURE-----

--ph4iustrdthgx54c--