realtek: dsa: Share port member configuration code
authorSven Eckelmann <[email protected]>
Thu, 9 Oct 2025 12:56:39 +0000 (14:56 +0200)
committerRobert Marko <[email protected]>
Sun, 12 Oct 2025 10:49:49 +0000 (12:49 +0200)
commit622e2d0971b5a5e2e5cb822b4dc6ca3a1c0af8be
treeffb844891f5b66c5983fac7944830430306cb123
parente696f39da816136746e37fa1a2f59349ddac28db
realtek: dsa: Share port member configuration code

The leave and join callbacks for DSA were using their own implementation of
the port member handling code. This makes the implementation of additional
functionality based on the port member matrix complicated because it needs
to be implemented in both places and also in the new code path for the
introduced feature.

By sharing this code, it is much easier to guarantee that all code paths
behave the same. This approach is already implemented by other DSA drivers
like qca8k, mt7530 or ksz.

Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20360
Signed-off-by: Robert Marko <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c