ASoC: au1x: psc-i2s: Convert to use devm_ioremap_resource
authorAxel Lin <axel.lin@ingics.com>
Sun, 30 Aug 2015 03:09:49 +0000 (11:09 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 30 Aug 2015 11:15:36 +0000 (12:15 +0100)
Use devm_ioremap_resource() instead of open code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/au1x/psc-i2s.c

index e742ef668496f5bae5674d471ec81757c37ab4b1..38e853add96ecb4236f50225e6089401a0740e22 100644 (file)
@@ -305,19 +305,9 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
                return -ENOMEM;
 
        iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!iores)
-               return -ENODEV;
-
-       ret = -EBUSY;
-       if (!devm_request_mem_region(&pdev->dev, iores->start,
-                                    resource_size(iores),
-                                    pdev->name))
-               return -EBUSY;
-
-       wd->mmio = devm_ioremap(&pdev->dev, iores->start,
-                               resource_size(iores));
-       if (!wd->mmio)
-               return -EBUSY;
+       wd->mmio = devm_ioremap_resource(&pdev->dev, iores);
+       if (IS_ERR(wd->mmio))
+               return PTR_ERR(wd->mmio);
 
        dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
        if (!dmares)