summaryrefslogtreecommitdiff
path: root/drivers/dma/sprd-dma.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-05-16 11:48:07 +0300
committerVinod Koul <vkoul@kernel.org>2018-05-17 07:27:34 +0300
commitfd8d26adc9a909c0c099265cb62d5e5ec2a87e7e (patch)
tree893b264807ec03f619e722dd5b6badc1f33a838e /drivers/dma/sprd-dma.c
parente7f063ae1a31e953bd2460d81697d18408f03641 (diff)
downloadlinux-fd8d26adc9a909c0c099265cb62d5e5ec2a87e7e.tar.xz
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: e7f063ae1a31 ("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>
Diffstat (limited to 'drivers/dma/sprd-dma.c')
-rw-r--r--drivers/dma/sprd-dma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index e715d07aa632..36df3b096bbc 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -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;