提交 fd8d26ad 编写于 作者: D Dan Carpenter 提交者: Vinod Koul

dmaengine: sprd: fix an NULL vs IS_ERR() bug

We recently cleaned this code up but we need to update the error
handling as well.  The devm_ioremap_resource() returns error pointers on
error, never NULL.

Fixes: e7f063ae ("dmaengine: sprd: Use devm_ioremap_resource() to map memory")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: NVinod Koul <vkoul@kernel.org>
上级 e7f063ae
......@@ -808,8 +808,8 @@ static int sprd_dma_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
sdev->glb_base = devm_ioremap_resource(&pdev->dev, res);
if (!sdev->glb_base)
return -ENOMEM;
if (IS_ERR(sdev->glb_base))
return PTR_ERR(sdev->glb_base);
dma_cap_set(DMA_MEMCPY, sdev->dma_dev.cap_mask);
sdev->total_chns = chn_count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册