Commit b5e7dc47 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by David S. Miller

liquidio: fix duplicated code for different branches

Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent da1542b0
...@@ -578,23 +578,18 @@ static int lio_set_phys_id(struct net_device *netdev, ...@@ -578,23 +578,18 @@ static int lio_set_phys_id(struct net_device *netdev,
break; break;
case ETHTOOL_ID_ON: case ETHTOOL_ID_ON:
if (oct->chip_id == OCTEON_CN66XX) { if (oct->chip_id == OCTEON_CN66XX)
octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG, octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG,
VITESSE_PHY_GPIO_HIGH); VITESSE_PHY_GPIO_HIGH);
else
} else if (oct->chip_id == OCTEON_CN68XX) {
return -EINVAL;
} else {
return -EINVAL; return -EINVAL;
}
break; break;
case ETHTOOL_ID_OFF: case ETHTOOL_ID_OFF:
if (oct->chip_id == OCTEON_CN66XX) if (oct->chip_id == OCTEON_CN66XX)
octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG, octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG,
VITESSE_PHY_GPIO_LOW); VITESSE_PHY_GPIO_LOW);
else if (oct->chip_id == OCTEON_CN68XX)
return -EINVAL;
else else
return -EINVAL; return -EINVAL;
......
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