]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/crypto/qat/qat_c62xvf/adf_drv.c
crypto: qat - simplify code and axe the use of a deprecated API
[mirror_ubuntu-jammy-kernel.git] / drivers / crypto / qat / qat_c62xvf / adf_drv.c
index 51ea88c0b17d7751515bb63e316ce85853e3f290..7bd23438bceeac6e061e055e1762fad4ed6e09cc 100644 (file)
@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
        /* set dma identifier */
-       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
-               if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
-                       dev_err(&pdev->dev, "No usable DMA configuration\n");
-                       ret = -EFAULT;
-                       goto out_err_disable;
-               } else {
-                       pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-               }
-
-       } else {
-               pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
+       ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+       if (ret) {
+               dev_err(&pdev->dev, "No usable DMA configuration\n");
+               goto out_err_disable;
        }
 
        if (pci_request_regions(pdev, ADF_C62XVF_DEVICE_NAME)) {