net: renesas: rswitch: do not deinit disabled ports

In rswitch_ether_port_init_all(), only enabled ports are initialized.
Then, rswitch_ether_port_deinit_all() shall also only deinitialize
enabled ports.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20241206192140.1714-1-nikita.yoush@cogentembedded.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Nikita Yushchenko 2024-12-07 00:21:39 +05:00 committed by Jakub Kicinski
parent 8a241ef9b9
commit 070927427d

View File

@ -1527,7 +1527,7 @@ static void rswitch_ether_port_deinit_all(struct rswitch_private *priv)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < RSWITCH_NUM_PORTS; i++) { rswitch_for_each_enabled_port(priv, i) {
phy_exit(priv->rdev[i]->serdes); phy_exit(priv->rdev[i]->serdes);
rswitch_ether_port_deinit_one(priv->rdev[i]); rswitch_ether_port_deinit_one(priv->rdev[i]);
} }