net: pcs: xpcs: export xpcs_validate
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 2 Jun 2021 16:20:14 +0000 (19:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Jun 2021 20:30:43 +0000 (13:30 -0700)
commita1a753ed1d4ae46c1c1874fb1af899f6579a7547
treefc73e5f34832ca8863a7aefc33ba0c96ddb22d0f
parent9900074ecccec472c9d89929c3d37c235f45d33a
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>
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/pcs/pcs-xpcs.c
include/linux/pcs/pcs-xpcs.h