Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: remove explicit phylink_generic_validate() references

Virtually all conventional network drivers are now converted to use
phylink_generic_validate() - only DSA drivers and fman_memac remain,
so lets remove the necessity for network drivers to explicitly set
this member, and default to phylink_generic_validate() when unset.
This is possible as .validate must currently be set.

Any remaining instances that have not been addressed by this patch can
be fixed up later.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/E1or0FZ-001tRa-DI@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
e1f4ecab 7ea8104d

+9 -20
-1
drivers/net/ethernet/altera/altera_tse_main.c
··· 1095 1095 } 1096 1096 1097 1097 static const struct phylink_mac_ops alt_tse_phylink_ops = { 1098 - .validate = phylink_generic_validate, 1099 1098 .mac_an_restart = alt_tse_mac_an_restart, 1100 1099 .mac_config = alt_tse_mac_config, 1101 1100 .mac_link_down = alt_tse_mac_link_down,
-1
drivers/net/ethernet/atheros/ag71xx.c
··· 1086 1086 } 1087 1087 1088 1088 static const struct phylink_mac_ops ag71xx_phylink_mac_ops = { 1089 - .validate = phylink_generic_validate, 1090 1089 .mac_config = ag71xx_mac_config, 1091 1090 .mac_link_down = ag71xx_mac_link_down, 1092 1091 .mac_link_up = ag71xx_mac_link_up,
-1
drivers/net/ethernet/cadence/macb_main.c
··· 742 742 } 743 743 744 744 static const struct phylink_mac_ops macb_phylink_ops = { 745 - .validate = phylink_generic_validate, 746 745 .mac_select_pcs = macb_mac_select_pcs, 747 746 .mac_config = macb_mac_config, 748 747 .mac_link_down = macb_mac_link_down,
-1
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
··· 236 236 } 237 237 238 238 static const struct phylink_mac_ops dpaa2_mac_phylink_ops = { 239 - .validate = phylink_generic_validate, 240 239 .mac_select_pcs = dpaa2_mac_select_pcs, 241 240 .mac_config = dpaa2_mac_config, 242 241 .mac_link_up = dpaa2_mac_link_up,
-1
drivers/net/ethernet/freescale/enetc/enetc_pf.c
··· 1111 1111 } 1112 1112 1113 1113 static const struct phylink_mac_ops enetc_mac_phylink_ops = { 1114 - .validate = phylink_generic_validate, 1115 1114 .mac_select_pcs = enetc_pl_mac_select_pcs, 1116 1115 .mac_config = enetc_pl_mac_config, 1117 1116 .mac_link_up = enetc_pl_mac_link_up,
-1
drivers/net/ethernet/freescale/fman/fman_dtsec.c
··· 986 986 } 987 987 988 988 static const struct phylink_mac_ops dtsec_mac_ops = { 989 - .validate = phylink_generic_validate, 990 989 .mac_select_pcs = dtsec_select_pcs, 991 990 .mac_config = dtsec_mac_config, 992 991 .mac_link_up = dtsec_link_up,
-1
drivers/net/ethernet/freescale/fman/fman_tgec.c
··· 469 469 } 470 470 471 471 static const struct phylink_mac_ops tgec_mac_ops = { 472 - .validate = phylink_generic_validate, 473 472 .mac_config = tgec_mac_config, 474 473 .mac_link_up = tgec_link_up, 475 474 .mac_link_down = tgec_link_down,
-1
drivers/net/ethernet/marvell/mvneta.c
··· 4228 4228 } 4229 4229 4230 4230 static const struct phylink_mac_ops mvneta_phylink_ops = { 4231 - .validate = phylink_generic_validate, 4232 4231 .mac_select_pcs = mvneta_mac_select_pcs, 4233 4232 .mac_prepare = mvneta_mac_prepare, 4234 4233 .mac_config = mvneta_mac_config,
-1
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
··· 6603 6603 } 6604 6604 6605 6605 static const struct phylink_mac_ops mvpp2_phylink_ops = { 6606 - .validate = phylink_generic_validate, 6607 6606 .mac_select_pcs = mvpp2_select_pcs, 6608 6607 .mac_prepare = mvpp2_mac_prepare, 6609 6608 .mac_config = mvpp2_mac_config,
-1
drivers/net/ethernet/marvell/prestera/prestera_main.c
··· 360 360 } 361 361 362 362 static const struct phylink_mac_ops prestera_mac_ops = { 363 - .validate = phylink_generic_validate, 364 363 .mac_select_pcs = prestera_mac_select_pcs, 365 364 .mac_config = prestera_mac_config, 366 365 .mac_link_down = prestera_mac_link_down,
-1
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 653 653 } 654 654 655 655 static const struct phylink_mac_ops mtk_phylink_ops = { 656 - .validate = phylink_generic_validate, 657 656 .mac_select_pcs = mtk_mac_select_pcs, 658 657 .mac_pcs_get_state = mtk_mac_pcs_get_state, 659 658 .mac_config = mtk_mac_config,
-1
drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c
··· 124 124 } 125 125 126 126 const struct phylink_mac_ops lan966x_phylink_mac_ops = { 127 - .validate = phylink_generic_validate, 128 127 .mac_select_pcs = lan966x_phylink_mac_select, 129 128 .mac_config = lan966x_phylink_mac_config, 130 129 .mac_prepare = lan966x_phylink_mac_prepare,
-1
drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
··· 138 138 }; 139 139 140 140 const struct phylink_mac_ops sparx5_phylink_mac_ops = { 141 - .validate = phylink_generic_validate, 142 141 .mac_select_pcs = sparx5_phylink_mac_select_pcs, 143 142 .mac_config = sparx5_phylink_mac_config, 144 143 .mac_link_down = sparx5_phylink_mac_link_down,
-1
drivers/net/ethernet/mscc/ocelot_net.c
··· 1727 1727 } 1728 1728 1729 1729 static const struct phylink_mac_ops ocelot_phylink_ops = { 1730 - .validate = phylink_generic_validate, 1731 1730 .mac_config = vsc7514_phylink_mac_config, 1732 1731 .mac_link_down = vsc7514_phylink_mac_link_down, 1733 1732 .mac_link_up = vsc7514_phylink_mac_link_up,
-1
drivers/net/ethernet/renesas/rswitch.c
··· 1190 1190 } 1191 1191 1192 1192 static const struct phylink_mac_ops rswitch_phylink_ops = { 1193 - .validate = phylink_generic_validate, 1194 1193 .mac_config = rswitch_mac_config, 1195 1194 .mac_link_down = rswitch_mac_link_down, 1196 1195 .mac_link_up = rswitch_mac_link_up,
-1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1080 1080 } 1081 1081 1082 1082 static const struct phylink_mac_ops stmmac_phylink_mac_ops = { 1083 - .validate = phylink_generic_validate, 1084 1083 .mac_select_pcs = stmmac_mac_select_pcs, 1085 1084 .mac_config = stmmac_mac_config, 1086 1085 .mac_link_down = stmmac_mac_link_down,
-1
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 1520 1520 } 1521 1521 1522 1522 static const struct phylink_mac_ops am65_cpsw_phylink_mac_ops = { 1523 - .validate = phylink_generic_validate, 1524 1523 .mac_config = am65_cpsw_nuss_mac_config, 1525 1524 .mac_link_down = am65_cpsw_nuss_mac_link_down, 1526 1525 .mac_link_up = am65_cpsw_nuss_mac_link_up,
-1
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
··· 1736 1736 } 1737 1737 1738 1738 static const struct phylink_mac_ops axienet_phylink_ops = { 1739 - .validate = phylink_generic_validate, 1740 1739 .mac_select_pcs = axienet_mac_select_pcs, 1741 1740 .mac_config = axienet_mac_config, 1742 1741 .mac_link_down = axienet_mac_link_down,
+4 -1
drivers/net/phy/phylink.c
··· 649 649 } 650 650 651 651 /* Then validate the link parameters with the MAC */ 652 - pl->mac_ops->validate(pl->config, supported, state); 652 + if (pl->mac_ops->validate) 653 + pl->mac_ops->validate(pl->config, supported, state); 654 + else 655 + phylink_generic_validate(pl->config, supported, state); 653 656 654 657 return phylink_is_empty_linkmode(supported) ? -EINVAL : 0; 655 658 }
-1
drivers/net/usb/asix_devices.c
··· 773 773 } 774 774 775 775 static const struct phylink_mac_ops ax88772_phylink_mac_ops = { 776 - .validate = phylink_generic_validate, 777 776 .mac_config = ax88772_mac_config, 778 777 .mac_link_down = ax88772_mac_link_down, 779 778 .mac_link_up = ax88772_mac_link_up,
+5
include/linux/phylink.h
··· 207 207 * 208 208 * If the @state->interface mode is not supported, then the @supported 209 209 * mask must be cleared. 210 + * 211 + * This member is optional; if not set, the generic validator will be 212 + * used making use of @config->mac_capabilities and 213 + * @config->supported_interfaces to determine which link modes are 214 + * supported. 210 215 */ 211 216 void validate(struct phylink_config *config, unsigned long *supported, 212 217 struct phylink_link_state *state);