e1000e: cleanup: remove e1000e_commit_phy()
Remove the function e1000e_commit_phy() and replace the few calls to it with the same function pointer that it would call. The function pointer is almost always set for the devices that access these code paths so there is no risk of a NULL pointer dereference; for the few instances where the function pointer might not be set (i.e. can be called for the few devices which do not have this function pointer set), check for a valid function pointer. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:

committed by
Jeff Kirsher

parent
dde3a5745c
commit
6b598e1eac
@@ -1321,7 +1321,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
||||
phy_reg |= 0x006;
|
||||
e1e_wphy(hw, PHY_REG(2, 21), phy_reg);
|
||||
/* Assert SW reset for above settings to take effect */
|
||||
e1000e_commit_phy(hw);
|
||||
hw->phy.ops.commit(hw);
|
||||
mdelay(1);
|
||||
/* Force Full Duplex */
|
||||
e1e_rphy(hw, PHY_REG(769, 16), &phy_reg);
|
||||
@@ -1542,7 +1542,8 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
||||
if (phy_reg & MII_CR_LOOPBACK) {
|
||||
phy_reg &= ~MII_CR_LOOPBACK;
|
||||
e1e_wphy(hw, PHY_CONTROL, phy_reg);
|
||||
e1000e_commit_phy(hw);
|
||||
if (hw->phy.ops.commit)
|
||||
hw->phy.ops.commit(hw);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user