Commit 5703a4b6 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller

net: axienet: remove interface checks in axienet_validate()

As phylink checks the interface mode against the supported_interfaces
bitmap, we no longer need to validate the interface mode in the
validation function. Remove this to simplify it.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 136a3fa2
...@@ -1507,29 +1507,8 @@ static void axienet_validate(struct phylink_config *config, ...@@ -1507,29 +1507,8 @@ static void axienet_validate(struct phylink_config *config,
unsigned long *supported, unsigned long *supported,
struct phylink_link_state *state) struct phylink_link_state *state)
{ {
struct net_device *ndev = to_net_dev(config->dev);
struct axienet_local *lp = netdev_priv(ndev);
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
/* Only support the mode we are configured for */
switch (state->interface) {
case PHY_INTERFACE_MODE_NA:
break;
case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_SGMII:
if (lp->switch_x_sgmii)
break;
fallthrough;
default:
if (state->interface != lp->phy_mode) {
netdev_warn(ndev, "Cannot use PHY mode %s, supported: %s\n",
phy_modes(state->interface),
phy_modes(lp->phy_mode));
linkmode_zero(supported);
return;
}
}
phylink_set(mask, Autoneg); phylink_set(mask, Autoneg);
phylink_set_port_modes(mask); phylink_set_port_modes(mask);
...@@ -1537,7 +1516,6 @@ static void axienet_validate(struct phylink_config *config, ...@@ -1537,7 +1516,6 @@ static void axienet_validate(struct phylink_config *config,
phylink_set(mask, Pause); phylink_set(mask, Pause);
switch (state->interface) { switch (state->interface) {
case PHY_INTERFACE_MODE_NA:
case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_GMII: case PHY_INTERFACE_MODE_GMII:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment