diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2012-08-20 16:23:48 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-08-23 12:11:15 -0400 |
commit | 10092438840729f2bc4892445db949b0e640835f (patch) | |
tree | 682f496c26ebea4b62fd55d76b63f5e95d25df93 /drivers/scsi | |
parent | 0921caf3264062c23b37abeee22c6d912430cc52 (diff) |
[SCSI] qla4xxx: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify qla2xxx driver.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 9ce3a8f8754f..7cfdf2bd8edb 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -1615,13 +1615,11 @@ qla82xx_get_fw_offs(struct qla_hw_data *ha) | |||
1615 | char * | 1615 | char * |
1616 | qla82xx_pci_info_str(struct scsi_qla_host *vha, char *str) | 1616 | qla82xx_pci_info_str(struct scsi_qla_host *vha, char *str) |
1617 | { | 1617 | { |
1618 | int pcie_reg; | ||
1619 | struct qla_hw_data *ha = vha->hw; | 1618 | struct qla_hw_data *ha = vha->hw; |
1620 | char lwstr[6]; | 1619 | char lwstr[6]; |
1621 | uint16_t lnk; | 1620 | uint16_t lnk; |
1622 | 1621 | ||
1623 | pcie_reg = pci_pcie_cap(ha->pdev); | 1622 | pcie_capability_read_word(ha->pdev, PCI_EXP_LNKSTA, &lnk); |
1624 | pci_read_config_word(ha->pdev, pcie_reg + PCI_EXP_LNKSTA, &lnk); | ||
1625 | ha->link_width = (lnk >> 4) & 0x3f; | 1623 | ha->link_width = (lnk >> 4) & 0x3f; |
1626 | 1624 | ||
1627 | strcpy(str, "PCIe ("); | 1625 | strcpy(str, "PCIe ("); |
@@ -2497,7 +2495,6 @@ fw_load_failed: | |||
2497 | int | 2495 | int |
2498 | qla82xx_start_firmware(scsi_qla_host_t *vha) | 2496 | qla82xx_start_firmware(scsi_qla_host_t *vha) |
2499 | { | 2497 | { |
2500 | int pcie_cap; | ||
2501 | uint16_t lnk; | 2498 | uint16_t lnk; |
2502 | struct qla_hw_data *ha = vha->hw; | 2499 | struct qla_hw_data *ha = vha->hw; |
2503 | 2500 | ||
@@ -2528,8 +2525,7 @@ qla82xx_start_firmware(scsi_qla_host_t *vha) | |||
2528 | } | 2525 | } |
2529 | 2526 | ||
2530 | /* Negotiated Link width */ | 2527 | /* Negotiated Link width */ |
2531 | pcie_cap = pci_pcie_cap(ha->pdev); | 2528 | pcie_capability_read_word(ha->pdev, PCI_EXP_LNKSTA, &lnk); |
2532 | pci_read_config_word(ha->pdev, pcie_cap + PCI_EXP_LNKSTA, &lnk); | ||
2533 | ha->link_width = (lnk >> 4) & 0x3f; | 2529 | ha->link_width = (lnk >> 4) & 0x3f; |
2534 | 2530 | ||
2535 | /* Synchronize with Receive peg */ | 2531 | /* Synchronize with Receive peg */ |