1 From 47bca7de6a4fb8dcb564c7ca14d885c91ed19e03 Mon Sep 17 00:00:00 2001
2 From: Sasha Neftin <sasha.neftin@intel.com>
3 Date: Sat, 10 Jul 2021 20:57:50 +0300
4 Subject: igc: Remove phy->type checking
6 i225 devices have only one phy->type: copper. There is no point checking
7 phy->type during the igc_has_link method from the watchdog that
8 invoked every 2 seconds.
9 This patch comes to clean up these pointless checkings.
11 Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
12 Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
13 Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
15 drivers/net/ethernet/intel/igc/igc_main.c | 15 ++++-----------
16 1 file changed, 4 insertions(+), 11 deletions(-)
18 (limited to 'drivers/net/ethernet/intel/igc')
20 --- a/drivers/net/ethernet/intel/igc/igc_main.c
21 +++ b/drivers/net/ethernet/intel/igc/igc_main.c
22 @@ -4177,17 +4177,10 @@ bool igc_has_link(struct igc_adapter *ad
23 * false until the igc_check_for_link establishes link
24 * for copper adapters ONLY
26 - switch (hw->phy.media_type) {
27 - case igc_media_type_copper:
28 - if (!hw->mac.get_link_status)
30 - hw->mac.ops.check_for_link(hw);
31 - link_active = !hw->mac.get_link_status;
34 - case igc_media_type_unknown:
37 + if (!hw->mac.get_link_status)
39 + hw->mac.ops.check_for_link(hw);
40 + link_active = !hw->mac.get_link_status;
42 if (hw->mac.type == igc_i225) {
43 if (!netif_carrier_ok(adapter->netdev)) {