diff options
author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2017-08-12 20:38:55 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-14 10:58:09 -0700 |
commit | b5e7dc47425860172eec6e1116ace7759d13b999 (patch) | |
tree | 1daae85740ce7e5aa329e0ed9061064ec3f80302 /drivers | |
parent | da1542b01b38ba29e0d28b1ef980071e7d38d6d4 (diff) | |
download | linux-b5e7dc47425860172eec6e1116ace7759d13b999.tar.bz2 |
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: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/lio_ethtool.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_ethtool.c b/drivers/net/ethernet/cavium/liquidio/lio_ethtool.c index b78e296c4cba..4f65c08461f6 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_ethtool.c @@ -578,23 +578,18 @@ static int lio_set_phys_id(struct net_device *netdev, break; case ETHTOOL_ID_ON: - if (oct->chip_id == OCTEON_CN66XX) { + if (oct->chip_id == OCTEON_CN66XX) octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG, VITESSE_PHY_GPIO_HIGH); - - } else if (oct->chip_id == OCTEON_CN68XX) { - return -EINVAL; - } else { + else return -EINVAL; - } + break; case ETHTOOL_ID_OFF: if (oct->chip_id == OCTEON_CN66XX) octnet_gpio_access(netdev, VITESSE_PHY_GPIO_CFG, VITESSE_PHY_GPIO_LOW); - else if (oct->chip_id == OCTEON_CN68XX) - return -EINVAL; else return -EINVAL; |