Skip to content

Commit

Permalink
crypto: cavium/zip - Use dma_set_mask_and_coherent to simplify code
Browse files Browse the repository at this point in the history
'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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
tititiou36 authored and herbertx committed Nov 27, 2020
1 parent abc6146 commit d4f9afb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/crypto/cavium/zip/zip_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,9 @@ static int zip_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
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) {
dev_err(dev, "Unable to get usable 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 allocations\n");
dev_err(dev, "Unable to get usable 48-bit DMA configuration\n");
goto err_release_regions;
}

Expand Down

0 comments on commit d4f9afb

Please sign in to comment.