summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/mv88e6xxx/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/chip.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index a12772a2bc11..a0790b9516f5 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -790,7 +790,7 @@ static int mv88e6xxx_mac_prepare(struct dsa_switch *ds, int port,
* is not forced down. Force the link down while we reconfigure the
* interface mode.
*/
- if (mode == MLO_AN_INBAND &&
+ if (phylink_mode_inband(mode) &&
chip->ports[port].interface != interface &&
chip->info->ops->port_set_link) {
mv88e6xxx_reg_lock(chip);
@@ -811,7 +811,7 @@ static void mv88e6xxx_mac_config(struct dsa_switch *ds, int port,
mv88e6xxx_reg_lock(chip);
- if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(ds, port)) {
+ if (!phylink_mode_phy(mode) || !mv88e6xxx_phy_is_internal(ds, port)) {
err = mv88e6xxx_port_config_interface(chip, port,
state->interface);
if (err && err != -EOPNOTSUPP)
@@ -840,9 +840,10 @@ static int mv88e6xxx_mac_finish(struct dsa_switch *ds, int port,
mv88e6xxx_reg_lock(chip);
if (chip->info->ops->port_set_link &&
- ((mode == MLO_AN_INBAND &&
+ ((phylink_mode_inband(mode) &&
chip->ports[port].interface != interface) ||
- (mode == MLO_AN_PHY && mv88e6xxx_port_ppu_updates(chip, port))))
+ (phylink_mode_phy(mode) &&
+ mv88e6xxx_port_ppu_updates(chip, port))))
err = chip->info->ops->port_set_link(chip, port, LINK_UNFORCED);
mv88e6xxx_reg_unlock(chip);
@@ -867,7 +868,7 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port,
* updated by the switch or if we are using fixed-link mode.
*/
if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
- mode == MLO_AN_FIXED) && ops->port_sync_link)
+ phylink_mode_fixed(mode)) && ops->port_sync_link)
err = ops->port_sync_link(chip, port, mode, false);
if (!err && ops->port_set_speed_duplex)
@@ -898,7 +899,7 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
* mode.
*/
if (!mv88e6xxx_port_ppu_updates(chip, port) ||
- mode == MLO_AN_FIXED) {
+ phylink_mode_fixed(mode)) {
if (ops->port_set_speed_duplex) {
err = ops->port_set_speed_duplex(chip, port,
speed, duplex);