1
0
Fork 0

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: e7f063ae1a ("dmaengine: sprd: Use devm_ioremap_resource() to map memory")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
hifive-unleashed-5.1
Dan Carpenter 2018-05-16 11:48:07 +03:00 committed by Vinod Koul
parent e7f063ae1a
commit fd8d26adc9
1 changed files with 2 additions and 2 deletions

View File

@ -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;