Commit 1983c435 authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

media: rc: Use devm_platform_ioremap_resource() in tango_ir_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 avatarMans Rullgard <mans@mansr.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6d7cc953
......@@ -157,20 +157,10 @@ static int tango_ir_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct rc_dev *rc;
struct tango_ir *ir;
struct resource *rc5_res;
struct resource *rc6_res;
u64 clkrate, clkdiv;
int irq, err;
u32 val;
rc5_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!rc5_res)
return -EINVAL;
rc6_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!rc6_res)
return -EINVAL;
irq = platform_get_irq(pdev, 0);
if (irq <= 0)
return -EINVAL;
......@@ -179,11 +169,11 @@ static int tango_ir_probe(struct platform_device *pdev)
if (!ir)
return -ENOMEM;
ir->rc5_base = devm_ioremap_resource(dev, rc5_res);
ir->rc5_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(ir->rc5_base))
return PTR_ERR(ir->rc5_base);
ir->rc6_base = devm_ioremap_resource(dev, rc6_res);
ir->rc6_base = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(ir->rc6_base))
return PTR_ERR(ir->rc6_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