mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
net: dsa: lantiq: clean up phylink_get_caps switch statement
Use case ranges for phylink_get_caps and remove the redundant "port N:" from the comments. Suggested-by: Vladimir Oltean <olteanv@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Link: https://patch.msgid.link/423daf99b3d60f510ff048a261c62d3de7d39321.1769099517.git.daniel@makrotopia.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
3383751185
commit
6d62284022
|
|
@ -33,8 +33,7 @@ static void gswip_xrx200_phylink_get_caps(struct dsa_switch *ds, int port,
|
|||
struct phylink_config *config)
|
||||
{
|
||||
switch (port) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 0 ... 1:
|
||||
phy_interface_set_rgmii(config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_MII,
|
||||
config->supported_interfaces);
|
||||
|
|
@ -44,9 +43,7 @@ static void gswip_xrx200_phylink_get_caps(struct dsa_switch *ds, int port,
|
|||
config->supported_interfaces);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 2 ... 4:
|
||||
case 6:
|
||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
|
||||
config->supported_interfaces);
|
||||
|
|
@ -75,10 +72,7 @@ static void gswip_xrx300_phylink_get_caps(struct dsa_switch *ds, int port,
|
|||
config->supported_interfaces);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 1 ... 4:
|
||||
case 6:
|
||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
|
||||
config->supported_interfaces);
|
||||
|
|
|
|||
|
|
@ -511,14 +511,12 @@ static void gsw1xx_phylink_get_caps(struct dsa_switch *ds, int port,
|
|||
MAC_10 | MAC_100 | MAC_1000;
|
||||
|
||||
switch (port) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 0 ... 3: /* built-in PHYs */
|
||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
|
||||
config->supported_interfaces);
|
||||
break;
|
||||
case 4: /* port 4: SGMII */
|
||||
|
||||
case 4: /* SGMII */
|
||||
__set_bit(PHY_INTERFACE_MODE_SGMII,
|
||||
config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_1000BASEX,
|
||||
|
|
@ -529,7 +527,8 @@ static void gsw1xx_phylink_get_caps(struct dsa_switch *ds, int port,
|
|||
config->mac_capabilities |= MAC_2500FD;
|
||||
}
|
||||
return; /* no support for EEE on SGMII port */
|
||||
case 5: /* port 5: RGMII or RMII */
|
||||
|
||||
case 5: /* RGMII or RMII */
|
||||
__set_bit(PHY_INTERFACE_MODE_RMII,
|
||||
config->supported_interfaces);
|
||||
phy_interface_set_rgmii(config->supported_interfaces);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user