e1000e: cleanup: rename goto labels to be more meaningful

In the following functions, rename the generic 'out' goto label to the more
descriptive 'release' to indicate the type of common work that is done
before exiting the functions.  No functional change, cosmetic only.

e1000_sw_lcd_config_ich8lan()
e1000_oem_bits_config_ich8lan()
e1000_init_phy_wakeup()
e1000e_write_phy_reg_bm()
e1000e_read_phy_reg_bm()
e1000e_read_phy_reg_bm2()

Signed-off-by: Bruce Allan <bruce.w.allan@intel.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:
Bruce Allan 2012-02-08 02:54:48 +00:00 committed by Jeff Kirsher
parent ffacd472c4
commit 75ce153270
3 changed files with 27 additions and 27 deletions

View File

@ -1065,7 +1065,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
data = er32(FEXTNVM); data = er32(FEXTNVM);
if (!(data & sw_cfg_mask)) if (!(data & sw_cfg_mask))
goto out; goto release;
/* /*
* Make sure HW does not configure LCD from PHY * Make sure HW does not configure LCD from PHY
@ -1074,14 +1074,14 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
data = er32(EXTCNF_CTRL); data = er32(EXTCNF_CTRL);
if (!(hw->mac.type == e1000_pch2lan)) { if (!(hw->mac.type == e1000_pch2lan)) {
if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
goto out; goto release;
} }
cnf_size = er32(EXTCNF_SIZE); cnf_size = er32(EXTCNF_SIZE);
cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT; cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
if (!cnf_size) if (!cnf_size)
goto out; goto release;
cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
@ -1097,13 +1097,13 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
*/ */
ret_val = e1000_write_smbus_addr(hw); ret_val = e1000_write_smbus_addr(hw);
if (ret_val) if (ret_val)
goto out; goto release;
data = er32(LEDCTL); data = er32(LEDCTL);
ret_val = e1000_write_phy_reg_hv_locked(hw, HV_LED_CONFIG, ret_val = e1000_write_phy_reg_hv_locked(hw, HV_LED_CONFIG,
(u16)data); (u16)data);
if (ret_val) if (ret_val)
goto out; goto release;
} }
/* Configure LCD from extended configuration region. */ /* Configure LCD from extended configuration region. */
@ -1115,12 +1115,12 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1, ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1,
&reg_data); &reg_data);
if (ret_val) if (ret_val)
goto out; goto release;
ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1), ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1),
1, &reg_addr); 1, &reg_addr);
if (ret_val) if (ret_val)
goto out; goto release;
/* Save off the PHY page for future writes. */ /* Save off the PHY page for future writes. */
if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) { if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
@ -1134,10 +1134,10 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
ret_val = phy->ops.write_reg_locked(hw, (u32)reg_addr, ret_val = phy->ops.write_reg_locked(hw, (u32)reg_addr,
reg_data); reg_data);
if (ret_val) if (ret_val)
goto out; goto release;
} }
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return ret_val; return ret_val;
} }
@ -1302,18 +1302,18 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
if (!(hw->mac.type == e1000_pch2lan)) { if (!(hw->mac.type == e1000_pch2lan)) {
mac_reg = er32(EXTCNF_CTRL); mac_reg = er32(EXTCNF_CTRL);
if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)
goto out; goto release;
} }
mac_reg = er32(FEXTNVM); mac_reg = er32(FEXTNVM);
if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M)) if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M))
goto out; goto release;
mac_reg = er32(PHY_CTRL); mac_reg = er32(PHY_CTRL);
ret_val = hw->phy.ops.read_reg_locked(hw, HV_OEM_BITS, &oem_reg); ret_val = hw->phy.ops.read_reg_locked(hw, HV_OEM_BITS, &oem_reg);
if (ret_val) if (ret_val)
goto out; goto release;
oem_reg &= ~(HV_OEM_BITS_GBE_DIS | HV_OEM_BITS_LPLU); oem_reg &= ~(HV_OEM_BITS_GBE_DIS | HV_OEM_BITS_LPLU);
@ -1339,7 +1339,7 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg);
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return ret_val; return ret_val;

View File

@ -5365,7 +5365,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
/* Enable access to wakeup registers on and set page to BM_WUC_PAGE */ /* Enable access to wakeup registers on and set page to BM_WUC_PAGE */
retval = e1000_enable_phy_wakeup_reg_access_bm(hw, &wuc_enable); retval = e1000_enable_phy_wakeup_reg_access_bm(hw, &wuc_enable);
if (retval) if (retval)
goto out; goto release;
/* copy MAC MTA to PHY MTA - only needed for pchlan */ /* copy MAC MTA to PHY MTA - only needed for pchlan */
for (i = 0; i < adapter->hw.mac.mta_reg_count; i++) { for (i = 0; i < adapter->hw.mac.mta_reg_count; i++) {
@ -5409,7 +5409,7 @@ static int e1000_init_phy_wakeup(struct e1000_adapter *adapter, u32 wufc)
retval = e1000_disable_phy_wakeup_reg_access_bm(hw, &wuc_enable); retval = e1000_disable_phy_wakeup_reg_access_bm(hw, &wuc_enable);
if (retval) if (retval)
e_err("Could not set PHY Host Wakeup bit\n"); e_err("Could not set PHY Host Wakeup bit\n");
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return retval; return retval;

View File

@ -2438,7 +2438,7 @@ s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data)
if (page == BM_WUC_PAGE) { if (page == BM_WUC_PAGE) {
ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data,
false, false); false, false);
goto out; goto release;
} }
hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset); hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset);
@ -2463,13 +2463,13 @@ s32 e1000e_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data)
ret_val = e1000e_write_phy_reg_mdic(hw, page_select, ret_val = e1000e_write_phy_reg_mdic(hw, page_select,
(page << page_shift)); (page << page_shift));
if (ret_val) if (ret_val)
goto out; goto release;
} }
ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
data); data);
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return ret_val; return ret_val;
} }
@ -2497,7 +2497,7 @@ s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data)
if (page == BM_WUC_PAGE) { if (page == BM_WUC_PAGE) {
ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data,
true, false); true, false);
goto out; goto release;
} }
hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset); hw->phy.addr = e1000_get_phy_addr_for_bm_page(page, offset);
@ -2522,12 +2522,12 @@ s32 e1000e_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data)
ret_val = e1000e_write_phy_reg_mdic(hw, page_select, ret_val = e1000e_write_phy_reg_mdic(hw, page_select,
(page << page_shift)); (page << page_shift));
if (ret_val) if (ret_val)
goto out; goto release;
} }
ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
data); data);
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return ret_val; return ret_val;
} }
@ -2555,7 +2555,7 @@ s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data)
if (page == BM_WUC_PAGE) { if (page == BM_WUC_PAGE) {
ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data,
true, false); true, false);
goto out; goto release;
} }
hw->phy.addr = 1; hw->phy.addr = 1;
@ -2567,12 +2567,12 @@ s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data)
page); page);
if (ret_val) if (ret_val)
goto out; goto release;
} }
ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
data); data);
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return ret_val; return ret_val;
} }
@ -2599,7 +2599,7 @@ s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data)
if (page == BM_WUC_PAGE) { if (page == BM_WUC_PAGE) {
ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data,
false, false); false, false);
goto out; goto release;
} }
hw->phy.addr = 1; hw->phy.addr = 1;
@ -2610,13 +2610,13 @@ s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data)
page); page);
if (ret_val) if (ret_val)
goto out; goto release;
} }
ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
data); data);
out: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
return ret_val; return ret_val;
} }