Skip to content

Commit 3e76ca9

Browse files
fredlawlmartinkpetersen
authored andcommitted
scsi: csiostor: Prefer pcie_capability_read_word()
Commit 8c0d3a0 ("PCI: Add accessors for PCI Express Capability") added accessors for the PCI Express Capability so that drivers didn't need to be aware of differences between v1 and v2 of the PCI Express Capability. Replace pci_read_config_word() and pci_write_config_word() calls with pcie_capability_read_word() and pcie_capability_write_word(). Signed-off-by: Frederick Lawler <fred@fredlawl.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 1d4f4a5 commit 3e76ca9

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎drivers/scsi/csiostor/csio_wr.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,6 @@ csio_wr_fixup_host_params(struct csio_hw *hw)
13161316
u32 fl_align = clsz < 32 ? 32 : clsz;
13171317
u32 pack_align;
13181318
u32 ingpad, ingpack;
1319-
int pcie_cap;
13201319

13211320
csio_wr_reg32(hw, HOSTPAGESIZEPF0_V(s_hps) | HOSTPAGESIZEPF1_V(s_hps) |
13221321
HOSTPAGESIZEPF2_V(s_hps) | HOSTPAGESIZEPF3_V(s_hps) |
@@ -1347,18 +1346,15 @@ csio_wr_fixup_host_params(struct csio_hw *hw)
13471346
* multiple of the Maximum Payload Size.
13481347
*/
13491348
pack_align = fl_align;
1350-
pcie_cap = pci_find_capability(hw->pdev, PCI_CAP_ID_EXP);
1351-
if (pcie_cap) {
1349+
if (pci_is_pcie(hw->pdev)) {
13521350
u32 mps, mps_log;
13531351
u16 devctl;
13541352

13551353
/* The PCIe Device Control Maximum Payload Size field
13561354
* [bits 7:5] encodes sizes as powers of 2 starting at
13571355
* 128 bytes.
13581356
*/
1359-
pci_read_config_word(hw->pdev,
1360-
pcie_cap + PCI_EXP_DEVCTL,
1361-
&devctl);
1357+
pcie_capability_read_word(hw->pdev, PCI_EXP_DEVCTL, &devctl);
13621358
mps_log = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5) + 7;
13631359
mps = 1 << mps_log;
13641360
if (mps > pack_align)

0 commit comments

Comments
 (0)