net: hns: bug fix for return values
authorQianqian Xie <xieqianqian@huawei.com>
Thu, 24 Mar 2016 11:08:02 +0000 (19:08 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Mar 2016 18:33:06 +0000 (14:33 -0400)
The return values in the first two functions mdiobus_write()
are ignored. The patch will fix it.

Signed-off-by: Qianqian Xie <xieqianqian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c

index 9c3ba65988e1ea604578e3fe52523ee8afb8d06e..0e7da3f0a564186e2930a90e154c2ca503bff361 100644 (file)
@@ -1013,8 +1013,8 @@ int hns_phy_led_set(struct net_device *netdev, int value)
        struct phy_device *phy_dev = priv->phy;
 
        retval = phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_LED);
-       retval = phy_write(phy_dev, HNS_LED_FC_REG, value);
-       retval = phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_COPPER);
+       retval |= phy_write(phy_dev, HNS_LED_FC_REG, value);
+       retval |= phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_COPPER);
        if (retval) {
                netdev_err(netdev, "mdiobus_write fail !\n");
                return retval;