Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: csiostor: Prefer pcie_capability_read_word()

Commit 8c0d3a02c130 ("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>

authored by

Frederick Lawler and committed by
Martin K. Petersen
3e76ca95 1d4f4a5e

+2 -6
+2 -6
drivers/scsi/csiostor/csio_wr.c
··· 1316 1316 u32 fl_align = clsz < 32 ? 32 : clsz; 1317 1317 u32 pack_align; 1318 1318 u32 ingpad, ingpack; 1319 - int pcie_cap; 1320 1319 1321 1320 csio_wr_reg32(hw, HOSTPAGESIZEPF0_V(s_hps) | HOSTPAGESIZEPF1_V(s_hps) | 1322 1321 HOSTPAGESIZEPF2_V(s_hps) | HOSTPAGESIZEPF3_V(s_hps) | ··· 1346 1347 * multiple of the Maximum Payload Size. 1347 1348 */ 1348 1349 pack_align = fl_align; 1349 - pcie_cap = pci_find_capability(hw->pdev, PCI_CAP_ID_EXP); 1350 - if (pcie_cap) { 1350 + if (pci_is_pcie(hw->pdev)) { 1351 1351 u32 mps, mps_log; 1352 1352 u16 devctl; 1353 1353 ··· 1354 1356 * [bits 7:5] encodes sizes as powers of 2 starting at 1355 1357 * 128 bytes. 1356 1358 */ 1357 - pci_read_config_word(hw->pdev, 1358 - pcie_cap + PCI_EXP_DEVCTL, 1359 - &devctl); 1359 + pcie_capability_read_word(hw->pdev, PCI_EXP_DEVCTL, &devctl); 1360 1360 mps_log = ((devctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5) + 7; 1361 1361 mps = 1 << mps_log; 1362 1362 if (mps > pack_align)