mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
net: phy: replace if-else statements with switch
Switch statement is clearer than a group of 'if-else'. Signed-off-by: Weihang Li <liweihang@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
33ab463220
commit
16d4d65096
1 changed files with 9 additions and 4 deletions
|
@ -809,14 +809,19 @@ static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev)
|
|||
{
|
||||
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;
|
||||
} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_RGMII_RXID:
|
||||
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;
|
||||
} else {
|
||||
break;
|
||||
default:
|
||||
delay = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return phy_modify(phydev, MII_M1111_PHY_EXT_CR,
|
||||
|
|
Loading…
Reference in a new issue