From 28eb232f217583e7bece8e9d6b26cf55a694ceae Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 10 Jul 2015 22:13:19 +0800 Subject: [PATCH] dmaengine: ti-dma-crossbar: Fix checking return value of devm_ioremap_resource devm_ioremap_resource returns ERR_PTR on failure. Signed-off-by: Axel Lin Acked-by: Peter Ujfalusi Signed-off-by: Vinod Koul --- drivers/dma/ti-dma-crossbar.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/dma/ti-dma-crossbar.c b/drivers/dma/ti-dma-crossbar.c index 10487d91e60d..5cce8c9d0026 100644 --- a/drivers/dma/ti-dma-crossbar.c +++ b/drivers/dma/ti-dma-crossbar.c @@ -162,12 +162,9 @@ static int ti_dma_xbar_probe(struct platform_device *pdev) xbar->safe_val = (u16)safe_val; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - iomem = devm_ioremap_resource(&pdev->dev, res); - if (!iomem) - return -ENOMEM; + if (IS_ERR(iomem)) + return PTR_ERR(iomem); xbar->iomem = iomem; -- 2.20.1