summaryrefslogtreecommitdiff
path: root/drivers/net/pcs
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-06-02 19:20:14 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-03 13:30:43 -0700
commita1a753ed1d4ae46c1c1874fb1af899f6579a7547 (patch)
treefc73e5f34832ca8863a7aefc33ba0c96ddb22d0f /drivers/net/pcs
parent9900074ecccec472c9d89929c3d37c235f45d33a (diff)
net: pcs: xpcs: export xpcs_validate
Calling a function pointer with a single implementation through struct mdio_xpcs_ops is clunky, and the stmmac_do_callback system forces this to return int, even though it always returns zero. Simply remove the "validate" function pointer from struct mdio_xpcs_ops and replace it with an exported xpcs_validate symbol which is called directly by stmmac. priv->hw->xpcs is of the type "const struct mdio_xpcs_ops *" and is used as a placeholder/synonym for priv->plat->mdio_bus_data->has_xpcs. It is done that way because the mdio_bus_data pointer might or might not be populated in all stmmac instantiations. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcs')
-rw-r--r--drivers/net/pcs/pcs-xpcs.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 610073cb55d0..2f7791bcf07b 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -685,9 +685,8 @@ static void xpcs_resolve_pma(struct mdio_xpcs_args *xpcs,
}
}
-static int xpcs_validate(struct mdio_xpcs_args *xpcs,
- unsigned long *supported,
- struct phylink_link_state *state)
+void xpcs_validate(struct mdio_xpcs_args *xpcs, unsigned long *supported,
+ struct phylink_link_state *state)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(xpcs_supported);
const struct xpcs_compat *compat;
@@ -698,7 +697,7 @@ static int xpcs_validate(struct mdio_xpcs_args *xpcs,
* advertising masks and exit.
*/
if (state->interface == PHY_INTERFACE_MODE_NA)
- return 0;
+ return;
bitmap_zero(xpcs_supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
@@ -713,9 +712,8 @@ static int xpcs_validate(struct mdio_xpcs_args *xpcs,
linkmode_and(supported, supported, xpcs_supported);
linkmode_and(state->advertising, state->advertising, xpcs_supported);
-
- return 0;
}
+EXPORT_SYMBOL_GPL(xpcs_validate);
static int xpcs_config_eee(struct mdio_xpcs_args *xpcs, int mult_fact_100ns,
int enable)
@@ -1031,7 +1029,6 @@ static int xpcs_probe(struct mdio_xpcs_args *xpcs, phy_interface_t interface)
}
static struct mdio_xpcs_ops xpcs_ops = {
- .validate = xpcs_validate,
.config = xpcs_config,
.get_state = xpcs_get_state,
.link_up = xpcs_link_up,