Skip to content

Commit 8c2703f

Browse files
arinc9kuba-moo
authored andcommitted
net: dsa: mt7530: remove pad_setup function pointer
The pad_setup function pointer was introduced with 88bdef8 ("net: dsa: mt7530: Extend device data ready for adding a new hardware"). It was being used to set up the core clock and port 6 of the MT7530 switch, and pll of the MT7531 switch. All of these were moved to more appropriate locations, and it was never used for the switch on the MT7988 SoC. Therefore, this function pointer hasn't got a use anymore. Remove it. Acked-by: Daniel Golle <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Signed-off-by: Arınç ÜNAL <[email protected]> Link: https://lore.kernel.org/r/20240206-for-netnext-mt7530-improvements-2-v5-5-d7d92a185cb1@arinc9.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 4ea4c04 commit 8c2703f

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -467,18 +467,6 @@ mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface)
467467
core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
468468
}
469469

470-
static int
471-
mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
472-
{
473-
return 0;
474-
}
475-
476-
static int
477-
mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
478-
{
479-
return 0;
480-
}
481-
482470
static void
483471
mt7531_pll_setup(struct mt7530_priv *priv)
484472
{
@@ -2603,14 +2591,6 @@ static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port,
26032591
}
26042592
}
26052593

2606-
static int
2607-
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
2608-
{
2609-
struct mt7530_priv *priv = ds->priv;
2610-
2611-
return priv->info->pad_setup(ds, state->interface);
2612-
}
2613-
26142594
static int
26152595
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
26162596
phy_interface_t interface)
@@ -2776,8 +2756,6 @@ mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
27762756
if (priv->p6_interface == state->interface)
27772757
break;
27782758

2779-
mt753x_pad_setup(ds, state);
2780-
27812759
if (mt753x_mac_config(ds, port, mode, state) < 0)
27822760
goto unsupported;
27832761

@@ -3094,11 +3072,6 @@ mt753x_conduit_state_change(struct dsa_switch *ds,
30943072
mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
30953073
}
30963074

3097-
static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
3098-
{
3099-
return 0;
3100-
}
3101-
31023075
static int mt7988_setup(struct dsa_switch *ds)
31033076
{
31043077
struct mt7530_priv *priv = ds->priv;
@@ -3162,7 +3135,6 @@ const struct mt753x_info mt753x_table[] = {
31623135
.phy_write_c22 = mt7530_phy_write_c22,
31633136
.phy_read_c45 = mt7530_phy_read_c45,
31643137
.phy_write_c45 = mt7530_phy_write_c45,
3165-
.pad_setup = mt7530_pad_clk_setup,
31663138
.mac_port_get_caps = mt7530_mac_port_get_caps,
31673139
.mac_port_config = mt7530_mac_config,
31683140
},
@@ -3174,7 +3146,6 @@ const struct mt753x_info mt753x_table[] = {
31743146
.phy_write_c22 = mt7530_phy_write_c22,
31753147
.phy_read_c45 = mt7530_phy_read_c45,
31763148
.phy_write_c45 = mt7530_phy_write_c45,
3177-
.pad_setup = mt7530_pad_clk_setup,
31783149
.mac_port_get_caps = mt7530_mac_port_get_caps,
31793150
.mac_port_config = mt7530_mac_config,
31803151
},
@@ -3186,7 +3157,6 @@ const struct mt753x_info mt753x_table[] = {
31863157
.phy_write_c22 = mt7531_ind_c22_phy_write,
31873158
.phy_read_c45 = mt7531_ind_c45_phy_read,
31883159
.phy_write_c45 = mt7531_ind_c45_phy_write,
3189-
.pad_setup = mt7531_pad_setup,
31903160
.cpu_port_config = mt7531_cpu_port_config,
31913161
.mac_port_get_caps = mt7531_mac_port_get_caps,
31923162
.mac_port_config = mt7531_mac_config,
@@ -3199,7 +3169,6 @@ const struct mt753x_info mt753x_table[] = {
31993169
.phy_write_c22 = mt7531_ind_c22_phy_write,
32003170
.phy_read_c45 = mt7531_ind_c45_phy_read,
32013171
.phy_write_c45 = mt7531_ind_c45_phy_write,
3202-
.pad_setup = mt7988_pad_setup,
32033172
.cpu_port_config = mt7988_cpu_port_config,
32043173
.mac_port_get_caps = mt7988_mac_port_get_caps,
32053174
.mac_port_config = mt7988_mac_config,
@@ -3229,9 +3198,8 @@ mt7530_probe_common(struct mt7530_priv *priv)
32293198
/* Sanity check if these required device operations are filled
32303199
* properly.
32313200
*/
3232-
if (!priv->info->sw_setup || !priv->info->pad_setup ||
3233-
!priv->info->phy_read_c22 || !priv->info->phy_write_c22 ||
3234-
!priv->info->mac_port_get_caps ||
3201+
if (!priv->info->sw_setup || !priv->info->phy_read_c22 ||
3202+
!priv->info->phy_write_c22 || !priv->info->mac_port_get_caps ||
32353203
!priv->info->mac_port_config)
32363204
return -EINVAL;
32373205

drivers/net/dsa/mt7530.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,6 @@ struct mt753x_pcs {
704704
* @phy_write_c22: Holding the way writing PHY port using C22
705705
* @phy_read_c45: Holding the way reading PHY port using C45
706706
* @phy_write_c45: Holding the way writing PHY port using C45
707-
* @pad_setup: Holding the way setting up the bus pad for a certain
708-
* MAC port
709707
* @phy_mode_supported: Check if the PHY type is being supported on a certain
710708
* port
711709
* @mac_port_validate: Holding the way to set addition validate type for a
@@ -726,7 +724,6 @@ struct mt753x_info {
726724
int regnum);
727725
int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
728726
int regnum, u16 val);
729-
int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
730727
int (*cpu_port_config)(struct dsa_switch *ds, int port);
731728
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
732729
struct phylink_config *config);

0 commit comments

Comments
 (0)