95226ace49428458ab5174d36c49b72ddeea0eec
[openwrt/staging/blocktrron.git] / target / linux / generic / backport-6.6 / 790-24-v6.9-net-dsa-mt7530-get-rid-of-mt753x_mac_config.patch
1 From c74a98baa8d098157975b3f94e496dd3a73e0864 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
3 Date: Fri, 1 Mar 2024 12:43:02 +0200
4 Subject: [PATCH 24/30] net: dsa: mt7530: get rid of mt753x_mac_config()
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 There is no need for a separate function to call
10 priv->info->mac_port_config(). Call it from mt753x_phylink_mac_config()
11 instead and remove mt753x_mac_config().
12
13 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
14 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
15 ---
16 drivers/net/dsa/mt7530.c | 14 ++------------
17 1 file changed, 2 insertions(+), 12 deletions(-)
18
19 --- a/drivers/net/dsa/mt7530.c
20 +++ b/drivers/net/dsa/mt7530.c
21 @@ -2670,16 +2670,6 @@ mt7531_mac_config(struct dsa_switch *ds,
22 }
23 }
24
25 -static void
26 -mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
27 - const struct phylink_link_state *state)
28 -{
29 - struct mt7530_priv *priv = ds->priv;
30 -
31 - if (priv->info->mac_port_config)
32 - priv->info->mac_port_config(ds, port, mode, state->interface);
33 -}
34 -
35 static struct phylink_pcs *
36 mt753x_phylink_mac_select_pcs(struct dsa_switch *ds, int port,
37 phy_interface_t interface)
38 @@ -2705,8 +2695,8 @@ mt753x_phylink_mac_config(struct dsa_swi
39 struct mt7530_priv *priv = ds->priv;
40 u32 mcr_cur, mcr_new;
41
42 - if (port == 5 || port == 6)
43 - mt753x_mac_config(ds, port, mode, state);
44 + if ((port == 5 || port == 6) && priv->info->mac_port_config)
45 + priv->info->mac_port_config(ds, port, mode, state->interface);
46
47 mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
48 mcr_new = mcr_cur;