diff options
| author | Jacob Keller <jacob.e.keller@intel.com> | 2014-02-21 20:23:58 -0500 |
|---|---|---|
| committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-20 03:37:29 -0400 |
| commit | 0d7c6e008e3f5b38e9126e7baeb35ce84581911a (patch) | |
| tree | 1ba2e58795fe5880f632097e1396f264c0438ebc | |
| parent | cbcc637059f0c4ba539e8e8a3be378c6329ac8e2 (diff) | |
ixgbe: use ixgbe_read_pci_cfg_word
This patch replaces some direct uses of pci_read_config_word with the
protected ixgbe_read_pci_cfg_word function, which checks for whether the
adapter is removed when LER is enabled. We shouldn't use the
pci_read_config_word calls directly because of these checks.
This patch also cleans up an unnecessary save of a pointer to the mac
object, as our standard style is to just use the hw pointer.
CC: Arun Sharma <asharma@fb.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c index 7a9d8744408f..911b711b6ba1 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | |||
| @@ -646,20 +646,17 @@ enum ixgbe_bus_speed ixgbe_convert_bus_speed(u16 link_status) | |||
| 646 | **/ | 646 | **/ |
| 647 | s32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw) | 647 | s32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw) |
| 648 | { | 648 | { |
| 649 | struct ixgbe_adapter *adapter = hw->back; | ||
| 650 | struct ixgbe_mac_info *mac = &hw->mac; | ||
| 651 | u16 link_status; | 649 | u16 link_status; |
| 652 | 650 | ||
| 653 | hw->bus.type = ixgbe_bus_type_pci_express; | 651 | hw->bus.type = ixgbe_bus_type_pci_express; |
| 654 | 652 | ||
| 655 | /* Get the negotiated link width and speed from PCI config space */ | 653 | /* Get the negotiated link width and speed from PCI config space */ |
| 656 | pci_read_config_word(adapter->pdev, IXGBE_PCI_LINK_STATUS, | 654 | link_status = ixgbe_read_pci_cfg_word(hw, IXGBE_PCI_LINK_STATUS); |
| 657 | &link_status); | ||
| 658 | 655 | ||
| 659 | hw->bus.width = ixgbe_convert_bus_width(link_status); | 656 | hw->bus.width = ixgbe_convert_bus_width(link_status); |
| 660 | hw->bus.speed = ixgbe_convert_bus_speed(link_status); | 657 | hw->bus.speed = ixgbe_convert_bus_speed(link_status); |
| 661 | 658 | ||
| 662 | mac->ops.set_lan_id(hw); | 659 | hw->mac.ops.set_lan_id(hw); |
| 663 | 660 | ||
| 664 | return 0; | 661 | return 0; |
| 665 | } | 662 | } |
| @@ -2437,12 +2434,10 @@ out: | |||
| 2437 | **/ | 2434 | **/ |
| 2438 | static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw) | 2435 | static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw) |
| 2439 | { | 2436 | { |
| 2440 | struct ixgbe_adapter *adapter = hw->back; | ||
| 2441 | s16 devctl2; | 2437 | s16 devctl2; |
| 2442 | u32 pollcnt; | 2438 | u32 pollcnt; |
| 2443 | 2439 | ||
| 2444 | pci_read_config_word(adapter->pdev, IXGBE_PCI_DEVICE_CONTROL2, | 2440 | devctl2 = ixgbe_read_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2); |
| 2445 | &devctl2); | ||
| 2446 | devctl2 &= IXGBE_PCIDEVCTRL2_TIMEO_MASK; | 2441 | devctl2 &= IXGBE_PCIDEVCTRL2_TIMEO_MASK; |
| 2447 | 2442 | ||
| 2448 | switch (devctl2) { | 2443 | switch (devctl2) { |
