Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: cavium/zip - 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>

authored by

Christophe JAILLET and committed by
Herbert Xu
d4f9afb2 abc6146a

+2 -8
+2 -8
drivers/crypto/cavium/zip/zip_main.c
··· 263 263 goto err_disable_device; 264 264 } 265 265 266 - err = pci_set_dma_mask(pdev, DMA_BIT_MASK(48)); 266 + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48)); 267 267 if (err) { 268 - dev_err(dev, "Unable to get usable DMA configuration\n"); 269 - goto err_release_regions; 270 - } 271 - 272 - err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(48)); 273 - if (err) { 274 - dev_err(dev, "Unable to get 48-bit DMA for allocations\n"); 268 + dev_err(dev, "Unable to get usable 48-bit DMA configuration\n"); 275 269 goto err_release_regions; 276 270 } 277 271