Commit 6e422cce authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Herbert Xu

crypto: qat - simplify code and axe the use of a deprecated API

The wrappers in include/linux/pci-dma-compat.h should go away.

Replace 'pci_set_dma_mask/pci_set_consistent_dma_mask' by an equivalent
and less verbose 'dma_set_mask_and_coherent()' call.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Co-developed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent fe4d5577
...@@ -221,16 +221,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -221,16 +221,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* Set DMA identifier */ /* Set DMA identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration.\n"); dev_err(&pdev->dev, "No usable DMA configuration.\n");
ret = -EFAULT; goto out_err;
goto out_err;
} else {
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
}
} else {
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
} }
/* Get accelerator capabilities mask */ /* Get accelerator capabilities mask */
......
...@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set dma identifier */ /* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration\n"); dev_err(&pdev->dev, "No usable DMA configuration\n");
ret = -EFAULT; goto out_err_disable;
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));
} }
if (pci_request_regions(pdev, ADF_C3XXX_DEVICE_NAME)) { if (pci_request_regions(pdev, ADF_C3XXX_DEVICE_NAME)) {
......
...@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set dma identifier */ /* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration\n"); dev_err(&pdev->dev, "No usable DMA configuration\n");
ret = -EFAULT; goto out_err_disable;
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));
} }
if (pci_request_regions(pdev, ADF_C3XXXVF_DEVICE_NAME)) { if (pci_request_regions(pdev, ADF_C3XXXVF_DEVICE_NAME)) {
......
...@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set dma identifier */ /* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration\n"); dev_err(&pdev->dev, "No usable DMA configuration\n");
ret = -EFAULT; goto out_err_disable;
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));
} }
if (pci_request_regions(pdev, ADF_C62X_DEVICE_NAME)) { if (pci_request_regions(pdev, ADF_C62X_DEVICE_NAME)) {
......
...@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set dma identifier */ /* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration\n"); dev_err(&pdev->dev, "No usable DMA configuration\n");
ret = -EFAULT; goto out_err_disable;
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));
} }
if (pci_request_regions(pdev, ADF_C62XVF_DEVICE_NAME)) { if (pci_request_regions(pdev, ADF_C62XVF_DEVICE_NAME)) {
......
...@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -159,17 +159,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set dma identifier */ /* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration\n"); dev_err(&pdev->dev, "No usable DMA configuration\n");
ret = -EFAULT; goto out_err_disable;
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));
} }
if (pci_request_regions(pdev, ADF_DH895XCC_DEVICE_NAME)) { if (pci_request_regions(pdev, ADF_DH895XCC_DEVICE_NAME)) {
......
...@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -141,17 +141,10 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/* set dma identifier */ /* set dma identifier */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { if (ret) {
dev_err(&pdev->dev, "No usable DMA configuration\n"); dev_err(&pdev->dev, "No usable DMA configuration\n");
ret = -EFAULT; goto out_err_disable;
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));
} }
if (pci_request_regions(pdev, ADF_DH895XCCVF_DEVICE_NAME)) { if (pci_request_regions(pdev, ADF_DH895XCCVF_DEVICE_NAME)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment