crypto: ccp - Use dma_set_mask_and_coherent to set DMA mask
authorTom Lendacky <thomas.lendacky@amd.com>
Tue, 3 Feb 2015 19:07:17 +0000 (13:07 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Feb 2015 09:48:48 +0000 (22:48 +1300)
Replace the setting of the DMA masks with the dma_set_mask_and_coherent
function call.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-platform.c

index 9e09c5023b5f8aa1f1b1e66b25d2cd51ed7e9754..04265a3c36085b96e92d182a4ffdb0fc20a600cc 100644 (file)
@@ -109,8 +109,11 @@ static int ccp_platform_probe(struct platform_device *pdev)
 
        if (!dev->dma_mask)
                dev->dma_mask = &dev->coherent_dma_mask;
-       *(dev->dma_mask) = DMA_BIT_MASK(48);
-       dev->coherent_dma_mask = DMA_BIT_MASK(48);
+       ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(48));
+       if (ret) {
+               dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n", ret);
+               goto e_free;
+       }
 
        if (of_property_read_bool(dev->of_node, "dma-coherent"))
                ccp->axcache = CACHE_WB_NO_ALLOC;