diff options
author | Gal Pressman <galpress@amazon.com> | 2020-12-01 12:18:11 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-12-02 04:03:23 +0300 |
commit | 87524494a7d939e6e120e893e2bdcc35599dfda1 (patch) | |
tree | 3abd156aede52690e59160a7cbe34f51a19606b5 /drivers/infiniband/hw/efa | |
parent | 05201e01be937be47e4c970c0a9eb6b6fb375b1e (diff) | |
download | linux-87524494a7d939e6e120e893e2bdcc35599dfda1.tar.xz |
RDMA/efa: Use dma_set_mask_and_coherent() to simplify code
Use dma_set_mask_and_coherent() instead of pci_set_dma_mask() followed by
a pci_set_consistent_dma_mask().
Link: https://lore.kernel.org/r/20201201091811.37984-1-galpress@amazon.com
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/efa')
-rw-r--r-- | drivers/infiniband/hw/efa/efa_main.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c index cb2f2c647ee5..0f578734bddb 100644 --- a/drivers/infiniband/hw/efa/efa_main.c +++ b/drivers/infiniband/hw/efa/efa_main.c @@ -384,19 +384,12 @@ static int efa_device_init(struct efa_com_dev *edev, struct pci_dev *pdev) return err; } - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(dma_width)); + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(dma_width)); if (err) { - dev_err(&pdev->dev, "pci_set_dma_mask failed %d\n", err); + dev_err(&pdev->dev, "dma_set_mask_and_coherent failed %d\n", err); return err; } - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(dma_width)); - if (err) { - dev_err(&pdev->dev, - "err_pci_set_consistent_dma_mask failed %d\n", - err); - return err; - } dma_set_max_seg_size(&pdev->dev, UINT_MAX); return 0; } |