790-42-v6.9-net-dsa-mt7530-get-rid-of-mt753x_mac_config.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 0c282205ef8c6dd6d2c145fac1fb6aba3e65c02d Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <[email protected]>
  3. Date: Fri, 1 Mar 2024 12:43:02 +0200
  4. Subject: [PATCH 42/48] 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. There is no need for a separate function to call
  9. priv->info->mac_port_config(). Call it from mt753x_phylink_mac_config()
  10. instead and remove mt753x_mac_config().
  11. Signed-off-by: Arınç ÜNAL <[email protected]>
  12. Signed-off-by: Paolo Abeni <[email protected]>
  13. ---
  14. drivers/net/dsa/mt7530.c | 14 ++------------
  15. 1 file changed, 2 insertions(+), 12 deletions(-)
  16. --- a/drivers/net/dsa/mt7530.c
  17. +++ b/drivers/net/dsa/mt7530.c
  18. @@ -2661,16 +2661,6 @@ mt7531_mac_config(struct dsa_switch *ds,
  19. }
  20. }
  21. -static void
  22. -mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
  23. - const struct phylink_link_state *state)
  24. -{
  25. - struct mt7530_priv *priv = ds->priv;
  26. -
  27. - if (priv->info->mac_port_config)
  28. - priv->info->mac_port_config(ds, port, mode, state->interface);
  29. -}
  30. -
  31. static struct phylink_pcs *
  32. mt753x_phylink_mac_select_pcs(struct dsa_switch *ds, int port,
  33. phy_interface_t interface)
  34. @@ -2696,8 +2686,8 @@ mt753x_phylink_mac_config(struct dsa_swi
  35. struct mt7530_priv *priv = ds->priv;
  36. u32 mcr_cur, mcr_new;
  37. - if (port == 5 || port == 6)
  38. - mt753x_mac_config(ds, port, mode, state);
  39. + if ((port == 5 || port == 6) && priv->info->mac_port_config)
  40. + priv->info->mac_port_config(ds, port, mode, state->interface);
  41. mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
  42. mcr_new = mcr_cur;