diff options
author | Jiasheng Jiang <[email protected]> | 2021-12-06 03:22:01 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2021-12-14 16:19:04 +0100 |
commit | 43f0633f89947df57fe0b5025bdd741768007708 (patch) | |
tree | bd60aba85986a73a97b60b5d3f28447b6093876d | |
parent | e0471a623c86f698ac2e7c9a4af6c53d9040e514 (diff) |
media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes
The return value of dma_set_coherent_mask() is not always 0.
To catch the exception in case that dma is not support the mask.
Link: https://lore.kernel.org/linux-media/[email protected]
Fixes: b0444f18e0b1 ("[media] coda: add i.MX6 VDOA driver")
Signed-off-by: Jiasheng Jiang <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/platform/coda/imx-vdoa.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/platform/coda/imx-vdoa.c b/drivers/media/platform/coda/imx-vdoa.c index 6996d4571e36..00643f37b3e6 100644 --- a/drivers/media/platform/coda/imx-vdoa.c +++ b/drivers/media/platform/coda/imx-vdoa.c @@ -287,7 +287,11 @@ static int vdoa_probe(struct platform_device *pdev) struct resource *res; int ret; - dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (ret) { + dev_err(&pdev->dev, "DMA enable failed\n"); + return ret; + } vdoa = devm_kzalloc(&pdev->dev, sizeof(*vdoa), GFP_KERNEL); if (!vdoa) |