mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-13 21:58:06 +04:00
Wrap all swconfig-specific code in mt7530.c with #if IS_ENABLED(CONFIG_SWCONFIG), including struct switch_dev, the vlan/port mapping tables and all switch_dev_ops callbacks. Register access helpers (mt7530_r32/w32), the PSC/HWTRAP definitions, and the small set of swconfig-only register macros and MIB tables further up the file remain unconditional - the latter two are unused-but-harmless when swconfig is disabled and are left alone to keep the diff focused. When swconfig is not compiled in, the driver performs only minimal hardware init (disables MAC learning on all ports, applies the HWTRAP fixup) and skips switch registration, mirroring the existing behaviour of the "mediatek,no-swconfig" device tree property. This removes the need for that property when building DSA-only images. The property is still honoured whenever CONFIG_SWCONFIG is enabled (built-in or as a module). A distinct log message is used for the compile-time case, to distinguish it from the runtime "mediatek,no-swconfig" case in dmesg. Also switch the existing runtime "swconfig disabled" message from pr_info() to dev_info(), changing its dmesg prefix from "mt7620: " / "mt7530: " to the device's own prefix. Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Link: https://github.com/openwrt/openwrt/pull/24574 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>