mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
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>
This commit is contained in:
committed by
David S. Miller
parent
9900074ecc
commit
a1a753ed1d
@@ -23,9 +23,6 @@ struct mdio_xpcs_args {
|
||||
};
|
||||
|
||||
struct mdio_xpcs_ops {
|
||||
int (*validate)(struct mdio_xpcs_args *xpcs,
|
||||
unsigned long *supported,
|
||||
struct phylink_link_state *state);
|
||||
int (*config)(struct mdio_xpcs_args *xpcs,
|
||||
const struct phylink_link_state *state);
|
||||
int (*get_state)(struct mdio_xpcs_args *xpcs,
|
||||
@@ -39,5 +36,7 @@ struct mdio_xpcs_ops {
|
||||
|
||||
int xpcs_get_an_mode(struct mdio_xpcs_args *xpcs, phy_interface_t interface);
|
||||
struct mdio_xpcs_ops *mdio_xpcs_get_ops(void);
|
||||
void xpcs_validate(struct mdio_xpcs_args *xpcs, unsigned long *supported,
|
||||
struct phylink_link_state *state);
|
||||
|
||||
#endif /* __LINUX_PCS_XPCS_H */
|
||||
|
||||
Reference in New Issue
Block a user