Commit e22f0e3f authored by Russell King's avatar Russell King

DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

Replace the following sequence:

	dma_set_mask(dev, mask);
	dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 052d0efa
...@@ -4797,21 +4797,8 @@ static int et131x_pci_setup(struct pci_dev *pdev, ...@@ -4797,21 +4797,8 @@ static int et131x_pci_setup(struct pci_dev *pdev,
pci_set_master(pdev); pci_set_master(pdev);
/* Check the DMA addressing support of this device */ /* Check the DMA addressing support of this device */
if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) &&
rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
if (rc < 0) {
dev_err(&pdev->dev,
"Unable to obtain 64 bit DMA for consistent allocations\n");
goto err_release_res;
}
} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
if (rc < 0) {
dev_err(&pdev->dev,
"Unable to obtain 32 bit DMA for consistent allocations\n");
goto err_release_res;
}
} else {
dev_err(&pdev->dev, "No usable DMA addressing method\n"); dev_err(&pdev->dev, "No usable DMA addressing method\n");
rc = -EIO; rc = -EIO;
goto err_release_res; goto err_release_res;
......
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