提交 42b858f6 编写于 作者: J Jiasheng Jiang 提交者: Zheng Zengkai

media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes

stable inclusion
from stable-v5.10.94
commit f6e4a6cbdb6fa32d204356da1b6d102b663df78b
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f6e4a6cbdb6fa32d204356da1b6d102b663df78b

--------------------------------

[ Upstream commit 43f0633f ]

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: b0444f18 ("[media] coda: add i.MX6 VDOA driver")
Signed-off-by: NJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 fcc6ebdd
...@@ -287,7 +287,11 @@ static int vdoa_probe(struct platform_device *pdev) ...@@ -287,7 +287,11 @@ static int vdoa_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int ret; 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); vdoa = devm_kzalloc(&pdev->dev, sizeof(*vdoa), GFP_KERNEL);
if (!vdoa) if (!vdoa)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册