mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
e1000: get rid of duplicate exit path
By using goto statement, we can achieve sharing the same exit path so that code duplication could be minimized. Signed-off-by: Jean Sacren <sakiwit@gmail.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
f03fed668a
commit
c619581a79
1 changed files with 3 additions and 4 deletions
|
@ -2822,14 +2822,13 @@ s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 *phy_data)
|
||||||
(reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
|
(reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
|
||||||
ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
|
ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
|
||||||
(u16) reg_addr);
|
(u16) reg_addr);
|
||||||
if (ret_val) {
|
if (ret_val)
|
||||||
spin_unlock_irqrestore(&e1000_phy_lock, flags);
|
goto out;
|
||||||
return ret_val;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret_val = e1000_read_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr,
|
ret_val = e1000_read_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr,
|
||||||
phy_data);
|
phy_data);
|
||||||
|
out:
|
||||||
spin_unlock_irqrestore(&e1000_phy_lock, flags);
|
spin_unlock_irqrestore(&e1000_phy_lock, flags);
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
Loading…
Add table
Reference in a new issue