Commit 16d4d650 authored by Weihang Li's avatar Weihang Li Committed by David S. Miller

net: phy: replace if-else statements with switch

Switch statement is clearer than a group of 'if-else'.
Signed-off-by: default avatarWeihang Li <liweihang@huawei.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 33ab4632
...@@ -809,14 +809,19 @@ static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev) ...@@ -809,14 +809,19 @@ static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev)
{ {
int delay; int delay;
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { switch (phydev->interface) {
case PHY_INTERFACE_MODE_RGMII_ID:
delay = MII_M1111_RGMII_RX_DELAY | MII_M1111_RGMII_TX_DELAY; delay = MII_M1111_RGMII_RX_DELAY | MII_M1111_RGMII_TX_DELAY;
} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { break;
case PHY_INTERFACE_MODE_RGMII_RXID:
delay = MII_M1111_RGMII_RX_DELAY; delay = MII_M1111_RGMII_RX_DELAY;
} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { break;
case PHY_INTERFACE_MODE_RGMII_TXID:
delay = MII_M1111_RGMII_TX_DELAY; delay = MII_M1111_RGMII_TX_DELAY;
} else { break;
default:
delay = 0; delay = 0;
break;
} }
return phy_modify(phydev, MII_M1111_PHY_EXT_CR, return phy_modify(phydev, MII_M1111_PHY_EXT_CR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment