Skip to content

Commit f6e4a6c

Browse files
JiangJiasgregkh
authored andcommitted
media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes
[ Upstream commit 43f0633 ] 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/20211206022201.1639460-1-jiasheng@iscas.ac.cn Fixes: b0444f1 ("[media] coda: add i.MX6 VDOA driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1a8869d commit f6e4a6c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎drivers/media/platform/coda/imx-vdoa.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,11 @@ static int vdoa_probe(struct platform_device *pdev)
287287
struct resource *res;
288288
int ret;
289289

290-
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
290+
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
291+
if (ret) {
292+
dev_err(&pdev->dev, "DMA enable failed\n");
293+
return ret;
294+
}
291295

292296
vdoa = devm_kzalloc(&pdev->dev, sizeof(*vdoa), GFP_KERNEL);
293297
if (!vdoa)

0 commit comments

Comments
 (0)