Commit ecb4d34f authored by Markus Elfring's avatar Markus Elfring Committed by Vinod Koul

dmaengine: owl: Use devm_platform_ioremap_resource() in owl_dma_probe()

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Link: https://lore.kernel.org/r/d36b6a6c-2e3d-8d68-6ddc-969a377ca3b2@web.deSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent a7dc0e6c
...@@ -1045,18 +1045,13 @@ static int owl_dma_probe(struct platform_device *pdev) ...@@ -1045,18 +1045,13 @@ static int owl_dma_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct owl_dma *od; struct owl_dma *od;
struct resource *res;
int ret, i, nr_channels, nr_requests; int ret, i, nr_channels, nr_requests;
od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL); od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
if (!od) if (!od)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); od->base = devm_platform_ioremap_resource(pdev, 0);
if (!res)
return -EINVAL;
od->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(od->base)) if (IS_ERR(od->base))
return PTR_ERR(od->base); return PTR_ERR(od->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment