aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rapidio')
-rw-r--r--drivers/rapidio/devices/tsi721.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 5d44252b7342..d5e1625bbac2 100644
--- a/drivers/rapidio/devices/tsi721.c
+++ b/drivers/rapidio/devices/tsi721.c
@@ -2219,9 +2219,7 @@ static int __devinit tsi721_probe(struct pci_dev *pdev,
2219 const struct pci_device_id *id) 2219 const struct pci_device_id *id)
2220{ 2220{
2221 struct tsi721_device *priv; 2221 struct tsi721_device *priv;
2222 int cap;
2223 int err; 2222 int err;
2224 u32 regval;
2225 2223
2226 priv = kzalloc(sizeof(struct tsi721_device), GFP_KERNEL); 2224 priv = kzalloc(sizeof(struct tsi721_device), GFP_KERNEL);
2227 if (priv == NULL) { 2225 if (priv == NULL) {
@@ -2330,20 +2328,16 @@ static int __devinit tsi721_probe(struct pci_dev *pdev,
2330 dev_info(&pdev->dev, "Unable to set consistent DMA mask\n"); 2328 dev_info(&pdev->dev, "Unable to set consistent DMA mask\n");
2331 } 2329 }
2332 2330
2333 cap = pci_pcie_cap(pdev); 2331 BUG_ON(!pci_is_pcie(pdev));
2334 BUG_ON(cap == 0);
2335 2332
2336 /* Clear "no snoop" and "relaxed ordering" bits, use default MRRS. */ 2333 /* Clear "no snoop" and "relaxed ordering" bits, use default MRRS. */
2337 pci_read_config_dword(pdev, cap + PCI_EXP_DEVCTL, &regval); 2334 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL,
2338 regval &= ~(PCI_EXP_DEVCTL_READRQ | PCI_EXP_DEVCTL_RELAX_EN | 2335 PCI_EXP_DEVCTL_READRQ | PCI_EXP_DEVCTL_RELAX_EN |
2339 PCI_EXP_DEVCTL_NOSNOOP_EN); 2336 PCI_EXP_DEVCTL_NOSNOOP_EN,
2340 regval |= 0x2 << MAX_READ_REQUEST_SZ_SHIFT; 2337 0x2 << MAX_READ_REQUEST_SZ_SHIFT);
2341 pci_write_config_dword(pdev, cap + PCI_EXP_DEVCTL, regval);
2342 2338
2343 /* Adjust PCIe completion timeout. */ 2339 /* Adjust PCIe completion timeout. */
2344 pci_read_config_dword(pdev, cap + PCI_EXP_DEVCTL2, &regval); 2340 pcie_capability_clear_and_set_word(pdev, PCI_EXP_DEVCTL2, 0xf, 0x2);
2345 regval &= ~(0x0f);
2346 pci_write_config_dword(pdev, cap + PCI_EXP_DEVCTL2, regval | 0x2);
2347 2341
2348 /* 2342 /*
2349 * FIXUP: correct offsets of MSI-X tables in the MSI-X Capability Block 2343 * FIXUP: correct offsets of MSI-X tables in the MSI-X Capability Block