summaryrefslogtreecommitdiff
path: root/drivers/crypto/cavium
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2020-11-21 10:56:47 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-11-27 09:13:48 +0300
commitaeb4d8c0f855304c158195ebae3917e244e63e57 (patch)
tree31fa6f96fdfc2518f1202832a251b33047c6a1cc /drivers/crypto/cavium
parent7f6c383b9505f7f9ec75831b154be97e7df49cac (diff)
downloadlinux-aeb4d8c0f855304c158195ebae3917e244e63e57.tar.xz
crypto: cavium - 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>
Diffstat (limited to 'drivers/crypto/cavium')
-rw-r--r--drivers/crypto/cavium/cpt/cptpf_main.c10
-rw-r--r--drivers/crypto/cavium/cpt/cptvf_main.c10
2 files changed, 4 insertions, 16 deletions
diff --git a/drivers/crypto/cavium/cpt/cptpf_main.c b/drivers/crypto/cavium/cpt/cptpf_main.c
index 781949027451..24d63bdc5dd2 100644
--- a/drivers/crypto/cavium/cpt/cptpf_main.c
+++ b/drivers/crypto/cavium/cpt/cptpf_main.c
@@ -569,15 +569,9 @@ static int cpt_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto cpt_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) {
- dev_err(dev, "Unable to get usable DMA configuration\n");
- goto cpt_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");
+ dev_err(dev, "Unable to get usable 48-bit DMA configuration\n");
goto cpt_err_release_regions;
}
diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c
index a15245992cf9..f016448e43bb 100644
--- a/drivers/crypto/cavium/cpt/cptvf_main.c
+++ b/drivers/crypto/cavium/cpt/cptvf_main.c
@@ -687,15 +687,9 @@ static int cptvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
/* Mark as VF driver */
cptvf->flags |= CPT_FLAG_VF_DRIVER;
- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48));
+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
if (err) {
- dev_err(dev, "Unable to get usable DMA configuration\n");
- goto cptvf_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");
+ dev_err(dev, "Unable to get usable 48-bit DMA configuration\n");
goto cptvf_err_release_regions;
}