790-34-v6.9-net-dsa-mt7530-remove-pad_setup-function-pointer.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. From fcbc5d900fa53f79963fe4626069739ee5567b4b Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <[email protected]>
  3. Date: Tue, 6 Feb 2024 01:08:06 +0300
  4. Subject: [PATCH 34/48] net: dsa: mt7530: remove pad_setup function pointer
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. The pad_setup function pointer was introduced with 88bdef8be9f6 ("net: dsa:
  9. mt7530: Extend device data ready for adding a new hardware"). It was being
  10. used to set up the core clock and port 6 of the MT7530 switch, and pll of
  11. the MT7531 switch.
  12. All of these were moved to more appropriate locations, and it was never
  13. used for the switch on the MT7988 SoC. Therefore, this function pointer
  14. hasn't got a use anymore. Remove it.
  15. Acked-by: Daniel Golle <[email protected]>
  16. Reviewed-by: Vladimir Oltean <[email protected]>
  17. Reviewed-by: Russell King (Oracle) <[email protected]>
  18. Signed-off-by: Arınç ÜNAL <[email protected]>
  19. Link: https://lore.kernel.org/r/20240206-for-netnext-mt7530-improvements-2-v5-5-d7d92a185cb1@arinc9.com
  20. Signed-off-by: Jakub Kicinski <[email protected]>
  21. ---
  22. drivers/net/dsa/mt7530.c | 36 ++----------------------------------
  23. drivers/net/dsa/mt7530.h | 3 ---
  24. 2 files changed, 2 insertions(+), 37 deletions(-)
  25. --- a/drivers/net/dsa/mt7530.c
  26. +++ b/drivers/net/dsa/mt7530.c
  27. @@ -453,18 +453,6 @@ mt7530_setup_port6(struct dsa_switch *ds
  28. core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
  29. }
  30. -static int
  31. -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
  32. -{
  33. - return 0;
  34. -}
  35. -
  36. -static int
  37. -mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
  38. -{
  39. - return 0;
  40. -}
  41. -
  42. static void
  43. mt7531_pll_setup(struct mt7530_priv *priv)
  44. {
  45. @@ -2631,14 +2619,6 @@ static void mt7988_mac_port_get_caps(str
  46. }
  47. static int
  48. -mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
  49. -{
  50. - struct mt7530_priv *priv = ds->priv;
  51. -
  52. - return priv->info->pad_setup(ds, state->interface);
  53. -}
  54. -
  55. -static int
  56. mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
  57. phy_interface_t interface)
  58. {
  59. @@ -2803,8 +2783,6 @@ mt753x_phylink_mac_config(struct dsa_swi
  60. if (priv->p6_interface == state->interface)
  61. break;
  62. - mt753x_pad_setup(ds, state);
  63. -
  64. if (mt753x_mac_config(ds, port, mode, state) < 0)
  65. goto unsupported;
  66. @@ -3127,11 +3105,6 @@ mt753x_conduit_state_change(struct dsa_s
  67. mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
  68. }
  69. -static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
  70. -{
  71. - return 0;
  72. -}
  73. -
  74. static int mt7988_setup(struct dsa_switch *ds)
  75. {
  76. struct mt7530_priv *priv = ds->priv;
  77. @@ -3192,7 +3165,6 @@ const struct mt753x_info mt753x_table[]
  78. .sw_setup = mt7530_setup,
  79. .phy_read = mt7530_phy_read,
  80. .phy_write = mt7530_phy_write,
  81. - .pad_setup = mt7530_pad_clk_setup,
  82. .mac_port_get_caps = mt7530_mac_port_get_caps,
  83. .mac_port_config = mt7530_mac_config,
  84. },
  85. @@ -3202,7 +3174,6 @@ const struct mt753x_info mt753x_table[]
  86. .sw_setup = mt7530_setup,
  87. .phy_read = mt7530_phy_read,
  88. .phy_write = mt7530_phy_write,
  89. - .pad_setup = mt7530_pad_clk_setup,
  90. .mac_port_get_caps = mt7530_mac_port_get_caps,
  91. .mac_port_config = mt7530_mac_config,
  92. },
  93. @@ -3212,7 +3183,6 @@ const struct mt753x_info mt753x_table[]
  94. .sw_setup = mt7531_setup,
  95. .phy_read = mt7531_ind_phy_read,
  96. .phy_write = mt7531_ind_phy_write,
  97. - .pad_setup = mt7531_pad_setup,
  98. .cpu_port_config = mt7531_cpu_port_config,
  99. .mac_port_get_caps = mt7531_mac_port_get_caps,
  100. .mac_port_config = mt7531_mac_config,
  101. @@ -3223,7 +3193,6 @@ const struct mt753x_info mt753x_table[]
  102. .sw_setup = mt7988_setup,
  103. .phy_read = mt7531_ind_phy_read,
  104. .phy_write = mt7531_ind_phy_write,
  105. - .pad_setup = mt7988_pad_setup,
  106. .cpu_port_config = mt7988_cpu_port_config,
  107. .mac_port_get_caps = mt7988_mac_port_get_caps,
  108. .mac_port_config = mt7988_mac_config,
  109. @@ -3253,9 +3222,8 @@ mt7530_probe_common(struct mt7530_priv *
  110. /* Sanity check if these required device operations are filled
  111. * properly.
  112. */
  113. - if (!priv->info->sw_setup || !priv->info->pad_setup ||
  114. - !priv->info->phy_read || !priv->info->phy_write ||
  115. - !priv->info->mac_port_get_caps ||
  116. + if (!priv->info->sw_setup || !priv->info->phy_read ||
  117. + !priv->info->phy_write || !priv->info->mac_port_get_caps ||
  118. !priv->info->mac_port_config)
  119. return -EINVAL;
  120. --- a/drivers/net/dsa/mt7530.h
  121. +++ b/drivers/net/dsa/mt7530.h
  122. @@ -722,8 +722,6 @@ struct mt753x_pcs {
  123. * @sw_setup: Holding the handler to a device initialization
  124. * @phy_read: Holding the way reading PHY port
  125. * @phy_write: Holding the way writing PHY port
  126. - * @pad_setup: Holding the way setting up the bus pad for a certain
  127. - * MAC port
  128. * @phy_mode_supported: Check if the PHY type is being supported on a certain
  129. * port
  130. * @mac_port_validate: Holding the way to set addition validate type for a
  131. @@ -739,7 +737,6 @@ struct mt753x_info {
  132. int (*sw_setup)(struct dsa_switch *ds);
  133. int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
  134. int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
  135. - int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
  136. int (*cpu_port_config)(struct dsa_switch *ds, int port);
  137. void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
  138. struct phylink_config *config);