Skip to content

Commit 261bf07

Browse files
tlendackyherbertx
authored andcommitted
crypto: ccp - Use dma_set_mask_and_coherent to set DMA mask
Replace the setting of the DMA masks with the dma_set_mask_and_coherent function call. Signed-off-by: Tom Lendacky <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent a5bd093 commit 261bf07

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/crypto/ccp/ccp-platform.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ static int ccp_platform_probe(struct platform_device *pdev)
109109

110110
if (!dev->dma_mask)
111111
dev->dma_mask = &dev->coherent_dma_mask;
112-
*(dev->dma_mask) = DMA_BIT_MASK(48);
113-
dev->coherent_dma_mask = DMA_BIT_MASK(48);
112+
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48));
113+
if (ret) {
114+
dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n", ret);
115+
goto e_free;
116+
}
114117

115118
if (of_property_read_bool(dev->of_node, "dma-coherent"))
116119
ccp->axcache = CACHE_WB_NO_ALLOC;

0 commit comments

Comments
 (0)