diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-05-12 23:20:48 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-18 17:02:20 -0400 |
commit | 7ab709910323a8af20722c066267516b3e7680a2 (patch) | |
tree | d35af8b1894b3813ef1fc7a6aea13fa9dbda78b9 /drivers/pci | |
parent | 430842e29d396928989c0a45e05025e988004d79 (diff) |
PCI ASPM: cleanup pcie_aspm_get_cap_device
Minor cleanup for pcie_aspm_get_cap_device().
Acked-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/aspm.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 0d0d3e630925..d85f77ff150c 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c | |||
@@ -292,19 +292,18 @@ static unsigned int calc_L1_latency(unsigned int latency_encoding, int ac) | |||
292 | } | 292 | } |
293 | 293 | ||
294 | static void pcie_aspm_get_cap_device(struct pci_dev *pdev, u32 *state, | 294 | static void pcie_aspm_get_cap_device(struct pci_dev *pdev, u32 *state, |
295 | unsigned int *l0s, unsigned int *l1, unsigned int *enabled) | 295 | u32 *l0s, u32 *l1, u32 *enabled) |
296 | { | 296 | { |
297 | int pos; | 297 | int pos; |
298 | u16 reg16; | 298 | u16 reg16; |
299 | u32 reg32; | 299 | u32 reg32, latency; |
300 | unsigned int latency; | ||
301 | 300 | ||
302 | *l0s = *l1 = *enabled = 0; | 301 | *l0s = *l1 = *enabled = 0; |
303 | pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 302 | pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); |
304 | pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, ®32); | 303 | pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, ®32); |
305 | *state = (reg32 & PCI_EXP_LNKCAP_ASPMS) >> 10; | 304 | *state = (reg32 & PCI_EXP_LNKCAP_ASPMS) >> 10; |
306 | if (*state != PCIE_LINK_STATE_L0S && | 305 | if (*state != PCIE_LINK_STATE_L0S && |
307 | *state != (PCIE_LINK_STATE_L1|PCIE_LINK_STATE_L0S)) | 306 | *state != (PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_L0S)) |
308 | *state = 0; | 307 | *state = 0; |
309 | if (*state == 0) | 308 | if (*state == 0) |
310 | return; | 309 | return; |
@@ -316,7 +315,7 @@ static void pcie_aspm_get_cap_device(struct pci_dev *pdev, u32 *state, | |||
316 | *l1 = calc_L1_latency(latency, 0); | 315 | *l1 = calc_L1_latency(latency, 0); |
317 | } | 316 | } |
318 | pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16); | 317 | pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, ®16); |
319 | *enabled = reg16 & (PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1); | 318 | *enabled = reg16 & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); |
320 | } | 319 | } |
321 | 320 | ||
322 | static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) | 321 | static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) |