]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/infiniband/hw/hfi1/pcie.c
RDMA: switch from 'pci_' to 'dma_' API
[mirror_ubuntu-jammy-kernel.git] / drivers / infiniband / hw / hfi1 / pcie.c
index 6f06e9920503723da2c3ee616879ee4da3ef7f01..b29242abedd122857940e5354c2e6e908a8835b2 100644 (file)
@@ -92,25 +92,18 @@ int hfi1_pcie_init(struct hfi1_devdata *dd)
                goto bail;
        }
 
-       ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
+       ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
        if (ret) {
                /*
                 * If the 64 bit setup fails, try 32 bit.  Some systems
                 * do not setup 64 bit maps on systems with 2GB or less
                 * memory installed.
                 */
-               ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+               ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
                if (ret) {
                        dd_dev_err(dd, "Unable to set DMA mask: %d\n", ret);
                        goto bail;
                }
-               ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-       } else {
-               ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
-       }
-       if (ret) {
-               dd_dev_err(dd, "Unable to set DMA consistent mask: %d\n", ret);
-               goto bail;
        }
 
        pci_set_master(pdev);