]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: pass pointer to hw struct for e1000_init_mac_params_XXX()
authorBruce Allan <bruce.w.allan@intel.com>
Wed, 1 Feb 2012 10:53:05 +0000 (10:53 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 07:48:36 +0000 (15:48 +0800)
The e1000_init_mac_params_XXX() functions (where XXX is one of the three
MAC-family types 80003es2lan, 82571 and ich8lan) was not meant to require a
pointer to the adapter struct but does require a pointer to the hw struct.
Pass that pointer in to the functions instead.

(cherry picked from commit ec34c170da8798f521f0d40cad54580ff93cea3a)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/e1000e/80003es2lan.c
drivers/net/e1000e/82571.c
drivers/net/e1000e/ich8lan.c

index 0bd11d06f0dfe3cd8067e3120ce7b8aed646c35f..460256988338322012fe5e953cf838505f50dcfa 100644 (file)
@@ -201,13 +201,12 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
  *  e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs.
  *  @hw: pointer to the HW structure
  **/
-static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
+static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
 {
-       struct e1000_hw *hw = &adapter->hw;
        struct e1000_mac_info *mac = &hw->mac;
 
        /* Set media type and media-dependent function pointers */
-       switch (adapter->pdev->device) {
+       switch (hw->adapter->pdev->device) {
        case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
                hw->phy.media_type = e1000_media_type_internal_serdes;
                mac->ops.check_for_link = e1000e_check_for_serdes_link;
@@ -246,7 +245,7 @@ static s32 e1000_get_variants_80003es2lan(struct e1000_adapter *adapter)
        struct e1000_hw *hw = &adapter->hw;
        s32 rc;
 
-       rc = e1000_init_mac_params_80003es2lan(adapter);
+       rc = e1000_init_mac_params_80003es2lan(hw);
        if (rc)
                return rc;
 
index b0d3dcca5da211d728ae9bc30af7d5c0634f5cba..af63e1579142e61ea6118470e2d0f82b1f0bee34 100644 (file)
@@ -235,16 +235,15 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
  *  e1000_init_mac_params_82571 - Init MAC func ptrs.
  *  @hw: pointer to the HW structure
  **/
-static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
+static s32 e1000_init_mac_params_82571(struct e1000_hw *hw)
 {
-       struct e1000_hw *hw = &adapter->hw;
        struct e1000_mac_info *mac = &hw->mac;
        u32 swsm = 0;
        u32 swsm2 = 0;
        bool force_clear_smbi = false;
 
        /* Set media type and media-dependent function pointers */
-       switch (adapter->pdev->device) {
+       switch (hw->adapter->pdev->device) {
        case E1000_DEV_ID_82571EB_FIBER:
        case E1000_DEV_ID_82572EI_FIBER:
        case E1000_DEV_ID_82571EB_QUAD_FIBER:
@@ -371,7 +370,7 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
        int is_port_b = er32(STATUS) & E1000_STATUS_FUNC_1;
        s32 rc;
 
-       rc = e1000_init_mac_params_82571(adapter);
+       rc = e1000_init_mac_params_82571(hw);
        if (rc)
                return rc;
 
index 69b206e4e399413578a313590f5fec83d7a9fe0d..e1df73379705cbf487a17344cff0c1f93760f1d3 100644 (file)
@@ -553,9 +553,8 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
  *  Initialize family-specific MAC parameters and function
  *  pointers.
  **/
-static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
+static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
 {
-       struct e1000_hw *hw = &adapter->hw;
        struct e1000_mac_info *mac = &hw->mac;
 
        /* Set media type function pointer */
@@ -775,7 +774,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
        struct e1000_hw *hw = &adapter->hw;
        s32 rc;
 
-       rc = e1000_init_mac_params_ich8lan(adapter);
+       rc = e1000_init_mac_params_ich8lan(hw);
        if (rc)
                return rc;