crypto: marvell/octeontx - Use dma_set_mask_and_coherent to simplify code

'pci_set_dma_mask()' + 'pci_set_consistent_dma_mask()' can be replaced by
an equivalent 'dma_set_mask_and_coherent()' which is much less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Christophe JAILLET 2020-11-21 08:49:16 +01:00 committed by Herbert Xu
parent d4f9afb233
commit 7f6c383b95
2 changed files with 4 additions and 16 deletions

View File

@ -212,15 +212,9 @@ static int otx_cpt_probe(struct pci_dev *pdev,
goto err_disable_device; goto err_disable_device;
} }
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48)); err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
if (err) { if (err) {
dev_err(dev, "Unable to get usable DMA configuration\n"); dev_err(dev, "Unable to get usable 48-bit DMA configuration\n");
goto err_release_regions;
}
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(48));
if (err) {
dev_err(dev, "Unable to get 48-bit DMA for consistent allocations\n");
goto err_release_regions; goto err_release_regions;
} }

View File

@ -804,15 +804,9 @@ static int otx_cptvf_probe(struct pci_dev *pdev,
dev_err(dev, "PCI request regions failed 0x%x\n", err); dev_err(dev, "PCI request regions failed 0x%x\n", err);
goto disable_device; goto disable_device;
} }
err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48)); err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
if (err) { if (err) {
dev_err(dev, "Unable to get usable DMA configuration\n"); dev_err(dev, "Unable to get usable 48-bit DMA configuration\n");
goto release_regions;
}
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(48));
if (err) {
dev_err(dev, "Unable to get 48-bit DMA for consistent allocations\n");
goto release_regions; goto release_regions;
} }