net: atheros: simplify the return expression of atl2_phy_setup_autoneg_adv()
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 8 Dec 2020 13:57:30 +0000 (21:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Dec 2020 00:22:54 +0000 (16:22 -0800)
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/atlx/atl2.c

index 7b80d924632ad804058628ce9a911111a8b98825..f016f2e12ee776f3f39ba28b6899a123e5f6f7dd 100644 (file)
@@ -2549,7 +2549,6 @@ static s32 atl2_write_phy_reg(struct atl2_hw *hw, u32 reg_addr, u16 phy_data)
  */
 static s32 atl2_phy_setup_autoneg_adv(struct atl2_hw *hw)
 {
-       s32 ret_val;
        s16 mii_autoneg_adv_reg;
 
        /* Read the MII Auto-Neg Advertisement Register (Address 4). */
@@ -2605,12 +2604,7 @@ static s32 atl2_phy_setup_autoneg_adv(struct atl2_hw *hw)
 
        hw->mii_autoneg_adv_reg = mii_autoneg_adv_reg;
 
-       ret_val = atl2_write_phy_reg(hw, MII_ADVERTISE, mii_autoneg_adv_reg);
-
-       if (ret_val)
-               return ret_val;
-
-       return 0;
+       return atl2_write_phy_reg(hw, MII_ADVERTISE, mii_autoneg_adv_reg);
 }
 
 /*