net: dsa: qca8k: fix led devicename when using external mdio bus
authorGeorge Moussalem <george.moussalem@outlook.com>
Fri, 25 Apr 2025 07:07:55 +0000 (11:07 +0400)
committerRobert Marko <robimarko@gmail.com>
Fri, 13 Jun 2025 10:02:39 +0000 (12:02 +0200)
commita23f8412894db465f1b5d5176f88c6f7d8120bce
treedd26bae21a0c33d33d99bd3f2bbec6cba174df64
parent323bbce6002db909100f22fca47a41fb71ce793e
net: dsa: qca8k: fix led devicename when using external mdio bus

The qca8k dsa switch can use either an external or internal mdio bus.
This depends on whether the mdio node is defined under the switch node
itself and, as such, the internal_mdio_mask is populated with its
internal phys. Upon registering the internal mdio bus, the
internal_mdio_bus of the dsa switch is assigned to this bus.
When an external mdio bus is used, it is left unassigned, though its id
is used to create the device names of the leds.
This leads to the leds being named '(efault):00:green:lan' and so on as
the internal_mdio_bus is null. So let's fix this by adding a null check
and use the devicename of the external bus instead when an external bus
is configured.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19004
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/patches-6.12/0753-net-dsa-qca8k-fix-led-devicename-when-using-external-mdio-bus.patch [new file with mode: 0644]