Skip to content

Commit 62a276f

Browse files
committed
[SCSI] qla2xxx: Use standard PCIe Capability Link register field names
Use the standard #defines for PCIe Link Capability register fields rather than bare numbers. This also uses the new PCI Express Capability accessor rather than reading the capability directly. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
1 parent a895c28 commit 62a276f

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

‎drivers/scsi/qla2xxx/qla_os.c‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -494,18 +494,14 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str)
494494
static char *pci_bus_modes[] = { "33", "66", "100", "133", };
495495
struct qla_hw_data *ha = vha->hw;
496496
uint32_t pci_bus;
497-
int pcie_reg;
498497

499-
pcie_reg = pci_pcie_cap(ha->pdev);
500-
if (pcie_reg) {
498+
if (pci_is_pcie(ha->pdev)) {
501499
char lwstr[6];
502-
uint16_t pcie_lstat, lspeed, lwidth;
500+
uint32_t lstat, lspeed, lwidth;
503501

504-
pcie_reg += PCI_EXP_LNKCAP;
505-
pci_read_config_word(ha->pdev, pcie_reg, &pcie_lstat);
506-
lspeed = pcie_lstat & (BIT_0 | BIT_1 | BIT_2 | BIT_3);
507-
lwidth = (pcie_lstat &
508-
(BIT_4 | BIT_5 | BIT_6 | BIT_7 | BIT_8 | BIT_9)) >> 4;
502+
pcie_capability_read_dword(ha->pdev, PCI_EXP_LNKCAP, &lstat);
503+
lspeed = lstat & PCI_EXP_LNKCAP_SLS;
504+
lwidth = (lstat & PCI_EXP_LNKCAP_MLW) >> 4;
509505

510506
strcpy(str, "PCIe (");
511507
switch (lspeed) {

0 commit comments

Comments
 (0)