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

net: dsa: sja1105: use .mac_select_pcs() interface

Convert the PCS selection to use mac_select_pcs, which allows the PCS
to perform any validation it needs, and removes the need to set the PCS
in the mac_config() callback, delving into the higher DSA levels to do
so.
Reviewed-by: default avatarVladimir Oltean &lt;olteanv@gmail.com&gt;                                Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c2b8e1e3
...@@ -1358,18 +1358,16 @@ static int sja1105_adjust_port_config(struct sja1105_private *priv, int port, ...@@ -1358,18 +1358,16 @@ static int sja1105_adjust_port_config(struct sja1105_private *priv, int port,
return sja1105_clocking_setup_port(priv, port); return sja1105_clocking_setup_port(priv, port);
} }
static void sja1105_mac_config(struct dsa_switch *ds, int port, static struct phylink_pcs *
unsigned int mode, sja1105_mac_select_pcs(struct dsa_switch *ds, int port, phy_interface_t iface)
const struct phylink_link_state *state)
{ {
struct dsa_port *dp = dsa_to_port(ds, port);
struct sja1105_private *priv = ds->priv; struct sja1105_private *priv = ds->priv;
struct dw_xpcs *xpcs; struct dw_xpcs *xpcs = priv->xpcs[port];
xpcs = priv->xpcs[port];
if (xpcs) if (xpcs)
phylink_set_pcs(dp->pl, &xpcs->pcs); return &xpcs->pcs;
return NULL;
} }
static void sja1105_mac_link_down(struct dsa_switch *ds, int port, static void sja1105_mac_link_down(struct dsa_switch *ds, int port,
...@@ -3137,7 +3135,7 @@ static const struct dsa_switch_ops sja1105_switch_ops = { ...@@ -3137,7 +3135,7 @@ static const struct dsa_switch_ops sja1105_switch_ops = {
.port_max_mtu = sja1105_get_max_mtu, .port_max_mtu = sja1105_get_max_mtu,
.phylink_get_caps = sja1105_phylink_get_caps, .phylink_get_caps = sja1105_phylink_get_caps,
.phylink_validate = sja1105_phylink_validate, .phylink_validate = sja1105_phylink_validate,
.phylink_mac_config = sja1105_mac_config, .phylink_mac_select_pcs = sja1105_mac_select_pcs,
.phylink_mac_link_up = sja1105_mac_link_up, .phylink_mac_link_up = sja1105_mac_link_up,
.phylink_mac_link_down = sja1105_mac_link_down, .phylink_mac_link_down = sja1105_mac_link_down,
.get_strings = sja1105_get_strings, .get_strings = sja1105_get_strings,
......
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