diff mbox series

[06/70] net/e1000/base: modify MAC initialization

Message ID 20200622064634.70941-7-guinanx.sun@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series update e1000 base code | expand

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch warning coding style issues

Commit Message

Guinan Sun June 22, 2020, 6:45 a.m. UTC
Fix mac initialization for i225 and i211 devices.
Fix parens to match the rest of the MAC checks.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/e1000/base/e1000_82575.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/e1000/base/e1000_82575.c b/drivers/net/e1000/base/e1000_82575.c
index 35a6ba502..4d7ef0ea2 100644
--- a/drivers/net/e1000/base/e1000_82575.c
+++ b/drivers/net/e1000/base/e1000_82575.c
@@ -433,7 +433,7 @@  STATIC s32 e1000_init_mac_params_82575(struct e1000_hw *hw)
 	else
 		mac->ops.reset_hw = e1000_reset_hw_82575;
 	/* hw initialization */
-	if ((mac->type == e1000_i210) || (mac->type == e1000_i211))
+	if (mac->type == e1000_i210 || mac->type == e1000_i211)
 		mac->ops.init_hw = e1000_init_hw_i210;
 	else
 #ifndef NO_I225_SUPPORT
@@ -441,7 +441,7 @@  STATIC s32 e1000_init_mac_params_82575(struct e1000_hw *hw)
 		mac->ops.init_hw = e1000_init_hw_i225;
 	else
 #endif /* NO_I225_SUPPORT */
-		mac->ops.init_hw = e1000_init_hw_82575;
+	mac->ops.init_hw = e1000_init_hw_82575;
 	/* link setup */
 	mac->ops.setup_link = e1000_setup_link_generic;
 	/* physical interface link setup */
@@ -492,11 +492,17 @@  STATIC s32 e1000_init_mac_params_82575(struct e1000_hw *hw)
 	/* acquire SW_FW sync */
 	mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_82575;
 	mac->ops.release_swfw_sync = e1000_release_swfw_sync_82575;
-	if (mac->type >= e1000_i210) {
+	if (mac->type == e1000_i210 || mac->type == e1000_i211) {
 		mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_i210;
 		mac->ops.release_swfw_sync = e1000_release_swfw_sync_i210;
 	}
+#ifndef NO_I225_SUPPORT
+	if (mac->type >= e1000_i225) {
+		mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync_i225;
+		mac->ops.release_swfw_sync = e1000_release_swfw_sync_i225;
+	}
 
+#endif /* NO_I225_SUPPORT */
 	/* set lan id for port to determine which phy lock to use */
 	hw->mac.ops.set_lan_id(hw);