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

dmaengine: at_xdmac: Use devm_platform_ioremap_resource() in at_xdmac_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>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/377247f3-b53a-a9d9-66c7-4b8515de3809@web.deSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent fcf8adb7
...@@ -1957,21 +1957,16 @@ static int atmel_xdmac_resume(struct device *dev) ...@@ -1957,21 +1957,16 @@ static int atmel_xdmac_resume(struct device *dev)
static int at_xdmac_probe(struct platform_device *pdev) static int at_xdmac_probe(struct platform_device *pdev)
{ {
struct resource *res;
struct at_xdmac *atxdmac; struct at_xdmac *atxdmac;
int irq, size, nr_channels, i, ret; int irq, size, nr_channels, i, ret;
void __iomem *base; void __iomem *base;
u32 reg; u32 reg;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) if (irq < 0)
return irq; return irq;
base = devm_ioremap_resource(&pdev->dev, res); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(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