net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled
authorArınç ÜNAL <arinc.unal@arinc9.com>
Mon, 22 Jan 2024 05:35:58 +0000 (08:35 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Jan 2024 02:04:12 +0000 (18:04 -0800)
commit04a22bef5fc2c3123fb8e517fecb650d510c5a47
tree9efd94bda28b8f1b62ed3b7da52e80bf12703d5e
parent6537973f2a5dc3e83a424142366fd15a2b97199f
net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled

There's no need to run all the code on mt7530_setup_port5() if port 5 is
disabled. The only case for calling mt7530_setup_port5() from
mt7530_setup() is when PHY muxing is enabled. That is because port 5 is not
defined as a port on the devicetree, therefore, it cannot be controlled by
phylink.

Because of this, run mt7530_setup_port5() if priv->p5_intf_sel is
P5_INTF_SEL_PHY_P0 or P5_INTF_SEL_PHY_P4. Remove the P5_DISABLED case from
mt7530_setup_port5().

Stop initialising the interface variable as the remaining cases will always
call mt7530_setup_port5() with it initialised.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20240122-for-netnext-mt7530-improvements-1-v3-7-042401f2b279@arinc9.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mt7530.c