Commit c2c6629b authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher

e1000e: cleanup: remove e1000_force_speed_duplex()

Remove the function e1000_force_speed_duplex() and replace the single call
to it with the same function pointer that it would call.  The function
pointer is always set so there is no risk of a NULL pointer dereference.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 7de89f05
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "e1000.h" #include "e1000.h"
static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw); static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw);
static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw);
static s32 e1000_wait_autoneg(struct e1000_hw *hw); static s32 e1000_wait_autoneg(struct e1000_hw *hw);
static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset, static s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
u16 *data, bool read, bool page_set); u16 *data, bool read, bool page_set);
...@@ -1196,7 +1195,7 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw) ...@@ -1196,7 +1195,7 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw)
* depending on user settings. * depending on user settings.
*/ */
e_dbg("Forcing Speed and Duplex\n"); e_dbg("Forcing Speed and Duplex\n");
ret_val = e1000_phy_force_speed_duplex(hw); ret_val = hw->phy.ops.force_speed_duplex(hw);
if (ret_val) { if (ret_val) {
e_dbg("Error Forcing Speed and Duplex\n"); e_dbg("Error Forcing Speed and Duplex\n");
return ret_val; return ret_val;
...@@ -2283,21 +2282,6 @@ static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) ...@@ -2283,21 +2282,6 @@ static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw)
return 0; return 0;
} }
/**
* e1000_phy_force_speed_duplex - Generic force PHY speed/duplex
* @hw: pointer to the HW structure
*
* When the silicon family has not implemented a forced speed/duplex
* function for the PHY, simply return 0.
**/
static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw)
{
if (hw->phy.ops.force_speed_duplex)
return hw->phy.ops.force_speed_duplex(hw);
return 0;
}
/** /**
* e1000e_get_phy_type_from_id - Get PHY type from id * e1000e_get_phy_type_from_id - Get PHY type from id
* @phy_id: phy_id read from the phy * @phy_id: phy_id read from the phy
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment