Thread (22 messages) 22 messages, 7 authors, 2012-02-13

[net-next 05/11] e1000e: cleanup e1000_init_mac_params_80003es2lan()

flat view
STALE5362d SUPERSEDED: 1 (0M)

From: Jeff Kirsher <hidden>
Date: 2012-02-07 12:34:14
Subsystem: intel ethernet drivers, networking drivers, the rest · Maintainers: Tony Nguyen, Przemek Kitszel, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 192 in this series; 1 review trailer.

Revisions (192)
  1. v1
  2. v2 [diff vs current]
  3. v1
  4. v1
  5. v2 [diff vs current]
  6. v1
  7. v1
  8. v1
  9. v1
  10. v1
  11. v1
  12. v1
  13. v1
  14. v2 [diff vs current]
  15. v1
  16. v3 [diff vs current]
  17. v1
  18. v1
  19. v1
  20. v2 [diff vs current]
  21. v2 [diff vs current]
  22. v1
  23. v2 [diff vs current]
  24. v1
  25. v2 [diff vs current]
  26. v3 [diff vs current]
  27. v1
  28. v1
  29. v1
  30. v2 [diff vs current]
  31. v1
  32. v1
  33. v1
  34. v2 [diff vs current]
  35. v1
  36. v1
  37. v1
  38. v1 current
  39. v1
  40. v2 [diff vs current]
  41. v1
  42. v1
  43. v1
  44. v1
  45. v1
  46. v1
  47. v1
  48. v1
  49. v1
  50. v1
  51. v1
  52. v1
  53. v1
  54. v1
  55. v2 [diff vs current]
  56. v1
  57. v1
  58. v1
  59. v1
  60. v1
  61. v1
  62. v1
  63. v1
  64. v1
  65. v1
  66. v1
  67. v1
  68. v1
  69. v1
  70. v1
  71. v1
  72. v1
  73. v1
  74. v1
  75. v1
  76. v1
  77. v1
  78. v1
  79. v1
  80. v1
  81. v1
  82. v1
  83. v2 [diff vs current]
  84. v1
  85. v1
  86. v1
  87. v1
  88. v1
  89. v2 [diff vs current]
  90. v1
  91. v1
  92. v1
  93. v1
  94. v2 [diff vs current]
  95. v1
  96. v2 [diff vs current]
  97. v1
  98. v1
  99. v1
  100. v1
  101. v1
  102. v1
  103. v1
  104. v1
  105. v1
  106. v2 [diff vs current]
  107. v1
  108. v1
  109. v2 [diff vs current]
  110. v1
  111. v1
  112. v1
  113. v1
  114. v1
  115. v1
  116. v2 [diff vs current]
  117. v1
  118. v2 [diff vs current]
  119. v2 [diff vs current]
  120. v1
  121. v2 [diff vs current]
  122. v3 [diff vs current]
  123. v1
  124. v4 [diff vs current]
  125. v1
  126. v5 [diff vs current]
  127. v6 [diff vs current]
  128. v7 [diff vs current]
  129. v1
  130. v1
  131. v2 [diff vs current]
  132. v1
  133. v1
  134. v1
  135. v2 [diff vs current]
  136. v1
  137. v1
  138. v1
  139. v1
  140. v2 [diff vs current]
  141. v1
  142. v1
  143. v1
  144. v1
  145. v2 [diff vs current]
  146. v1
  147. v1
  148. v1
  149. v2 [diff vs current]
  150. v3 [diff vs current]
  151. v4 [diff vs current]
  152. v1
  153. v1
  154. v2 [diff vs current]
  155. v5 [diff vs current]
  156. v1
  157. v1
  158. v1
  159. v2 [diff vs current]
  160. v1
  161. v1
  162. v2 [diff vs current]
  163. v3 [diff vs current]
  164. v1
  165. v2 [diff vs current]
  166. v1
  167. v1
  168. v2 [diff vs current]
  169. v1
  170. v2 [diff vs current]
  171. v1
  172. v2 [diff vs current]
  173. v3 [diff vs current]
  174. v1
  175. v1
  176. v1
  177. v2 [diff vs current]
  178. v1
  179. v1
  180. v1
  181. v1
  182. v1
  183. v1
  184. v2 [diff vs current]
  185. v1
  186. v1
  187. v1
  188. v2 [diff vs current]
  189. v1
  190. v1
  191. v1
  192. v2 [diff vs current]
From: Bruce Allan <redacted>

Combine two switch statements into one, convert a nebulous pointer to one
that is a bit more in keeping with the rest of the driver code and remove
some dead code (there are no 80003es2lan devices with fiber).  No change in
functionality, just cosmetic changes.

Signed-off-by: Bruce Allan <redacted>
Tested-by: Aaron Brown <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/ethernet/intel/e1000e/80003es2lan.c |   28 +++++-----------------
 1 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index 82a5d87..9b96961 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -205,15 +205,20 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	struct e1000_mac_info *mac = &hw->mac;
-	struct e1000_mac_operations *func = &mac->ops;
 
-	/* Set media type */
+	/* Set media type and media-dependent function pointers */
 	switch (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;
+		mac->ops.setup_physical_interface =
+		    e1000e_setup_fiber_serdes_link;
 		break;
 	default:
 		hw->phy.media_type = e1000_media_type_copper;
+		mac->ops.check_for_link = e1000e_check_for_copper_link;
+		mac->ops.setup_physical_interface =
+		    e1000_setup_copper_link_80003es2lan;
 		break;
 	}
 
@@ -230,25 +235,6 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
 	/* Adaptive IFS not supported */
 	mac->adaptive_ifs = false;
 
-	/* check for link */
-	switch (hw->phy.media_type) {
-	case e1000_media_type_copper:
-		func->setup_physical_interface = e1000_setup_copper_link_80003es2lan;
-		func->check_for_link = e1000e_check_for_copper_link;
-		break;
-	case e1000_media_type_fiber:
-		func->setup_physical_interface = e1000e_setup_fiber_serdes_link;
-		func->check_for_link = e1000e_check_for_fiber_link;
-		break;
-	case e1000_media_type_internal_serdes:
-		func->setup_physical_interface = e1000e_setup_fiber_serdes_link;
-		func->check_for_link = e1000e_check_for_serdes_link;
-		break;
-	default:
-		return -E1000_ERR_CONFIG;
-		break;
-	}
-
 	/* set lan id for port to determine which phy lock to use */
 	hw->mac.ops.set_lan_id(hw);
 
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help