dmaengine: ti-dma-crossbar: Fix checking return value of devm_ioremap_resource
authorAxel Lin <axel.lin@ingics.com>
Fri, 10 Jul 2015 14:13:19 +0000 (22:13 +0800)
committerVinod Koul <vinod.koul@intel.com>
Wed, 5 Aug 2015 05:10:06 +0000 (10:40 +0530)
devm_ioremap_resource returns ERR_PTR on failure.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ti-dma-crossbar.c

index 10487d91e60d452505d775dfb72a3d4c12f593c2..5cce8c9d00265bd41e556e991ad3d374431c9f0b 100644 (file)
@@ -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;