diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-12-05 15:51:20 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-12-07 13:19:54 -0500 |
commit | b9d146e30a2d855229f0944152f84aef1a21553b (patch) | |
tree | efb7abc2711019cf40e74d709652339b25dc5171 /drivers | |
parent | f93eaffcacb43b5764fb440ef50bf88dc7a2eb3e (diff) |
iwlwifi: collapse wrapper for pcie_capability_read_word()
iwl_pciexp_link_ctrl() has only one call site and no longer provides any
useful abstraction, so collapse it into the caller.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index fe0fffd04304..5cd06b3246fe 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -673,18 +673,11 @@ static void iwl_set_pwr_vmain(struct iwl_trans *trans) | |||
673 | #define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01 | 673 | #define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01 |
674 | #define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02 | 674 | #define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02 |
675 | 675 | ||
676 | static u16 iwl_pciexp_link_ctrl(struct iwl_trans *trans) | 676 | static void iwl_apm_config(struct iwl_trans *trans) |
677 | { | 677 | { |
678 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 678 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
679 | u16 pci_lnk_ctl; | 679 | u16 lctl; |
680 | |||
681 | pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, | ||
682 | &pci_lnk_ctl); | ||
683 | return pci_lnk_ctl; | ||
684 | } | ||
685 | 680 | ||
686 | static void iwl_apm_config(struct iwl_trans *trans) | ||
687 | { | ||
688 | /* | 681 | /* |
689 | * HW bug W/A for instability in PCIe bus L0S->L1 transition. | 682 | * HW bug W/A for instability in PCIe bus L0S->L1 transition. |
690 | * Check if BIOS (or OS) enabled L1-ASPM on this device. | 683 | * Check if BIOS (or OS) enabled L1-ASPM on this device. |
@@ -693,8 +686,8 @@ static void iwl_apm_config(struct iwl_trans *trans) | |||
693 | * If not (unlikely), enable L0S, so there is at least some | 686 | * If not (unlikely), enable L0S, so there is at least some |
694 | * power savings, even without L1. | 687 | * power savings, even without L1. |
695 | */ | 688 | */ |
696 | u16 lctl = iwl_pciexp_link_ctrl(trans); | ||
697 | 689 | ||
690 | pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, &lctl); | ||
698 | if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == | 691 | if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == |
699 | PCI_CFG_LINK_CTRL_VAL_L1_EN) { | 692 | PCI_CFG_LINK_CTRL_VAL_L1_EN) { |
700 | /* L1-ASPM enabled; disable(!) L0S */ | 693 | /* L1-ASPM enabled; disable(!) L0S */ |