]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dmaengine: owl: Use devm_platform_ioremap_resource() in owl_dma_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 22 Sep 2019 11:23:54 +0000 (13:23 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 14 Oct 2019 07:51:20 +0000 (13:21 +0530)
Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/d36b6a6c-2e3d-8d68-6ddc-969a377ca3b2@web.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/owl-dma.c

index 90bbcef99ef849f2af4311721728e2182d6044d8..023f951189a727af61771991c85be0ac650449e3 100644 (file)
@@ -1045,18 +1045,13 @@ static int owl_dma_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
        struct owl_dma *od;
-       struct resource *res;
        int ret, i, nr_channels, nr_requests;
 
        od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
        if (!od)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res)
-               return -EINVAL;
-
-       od->base = devm_ioremap_resource(&pdev->dev, res);
+       od->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(od->base))
                return PTR_ERR(od->base);