Skip to content

Commit 46587e4

Browse files
viviendavem330
authored andcommitted
net: dsa: remove PHY device argument from .set_eee
The DSA switch operations for EEE are only meant to configure a port's MAC EEE settings. The port's PHY EEE settings are accessed by the DSA layer and must be made available via a proper PHY driver. In order to reduce this confusion, remove the phy_device argument from the .set_eee operation. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c48f7eb commit 46587e4

File tree

5 files changed

+5
-15
lines changed

5 files changed

+5
-15
lines changed

drivers/net/dsa/bcm_sf2.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ static int bcm_sf2_sw_get_eee(struct dsa_switch *ds, int port,
353353
}
354354

355355
static int bcm_sf2_sw_set_eee(struct dsa_switch *ds, int port,
356-
struct phy_device *phydev,
357356
struct ethtool_eee *e)
358357
{
359358
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static int mv88e6xxx_get_eee(struct dsa_switch *ds, int port,
850850
}
851851

852852
static int mv88e6xxx_set_eee(struct dsa_switch *ds, int port,
853-
struct phy_device *phydev, struct ethtool_eee *e)
853+
struct ethtool_eee *e)
854854
{
855855
struct mv88e6xxx_chip *chip = ds->priv;
856856
int err;

drivers/net/dsa/qca8k.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -637,29 +637,21 @@ qca8k_get_sset_count(struct dsa_switch *ds)
637637
return ARRAY_SIZE(ar8327_mib);
638638
}
639639

640-
static void
641-
qca8k_eee_enable_set(struct dsa_switch *ds, int port, bool enable)
640+
static int
641+
qca8k_set_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
642642
{
643643
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
644644
u32 lpi_en = QCA8K_REG_EEE_CTRL_LPI_EN(port);
645645
u32 reg;
646646

647647
mutex_lock(&priv->reg_mutex);
648648
reg = qca8k_read(priv, QCA8K_REG_EEE_CTRL);
649-
if (enable)
649+
if (eee->eee_enabled)
650650
reg |= lpi_en;
651651
else
652652
reg &= ~lpi_en;
653653
qca8k_write(priv, QCA8K_REG_EEE_CTRL, reg);
654654
mutex_unlock(&priv->reg_mutex);
655-
}
656-
657-
static int
658-
qca8k_set_eee(struct dsa_switch *ds, int port,
659-
struct phy_device *phydev,
660-
struct ethtool_eee *e)
661-
{
662-
qca8k_eee_enable_set(ds, port, e->eee_enabled);
663655

664656
return 0;
665657
}

include/net/dsa.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ struct dsa_switch_ops {
335335
* EEE setttings
336336
*/
337337
int (*set_eee)(struct dsa_switch *ds, int port,
338-
struct phy_device *phydev,
339338
struct ethtool_eee *e);
340339
int (*get_eee)(struct dsa_switch *ds, int port,
341340
struct ethtool_eee *e);

net/dsa/slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
655655
if (!ds->ops->set_eee)
656656
return -EOPNOTSUPP;
657657

658-
ret = ds->ops->set_eee(ds, p->dp->index, p->phy, e);
658+
ret = ds->ops->set_eee(ds, p->dp->index, e);
659659
if (ret)
660660
return ret;
661661

0 commit comments

Comments
 (0)