From: Markus Elfring <Markus.Elfring@web•de>
To: linux-media@vger•kernel.org,
linux-arm-kernel@lists•infradead.org,
Allison Randal <allison@lohutok•net>,
Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
Mans Rullgard <mans@mansr•com>,
Marc Gonzalez <marc.w.gonzalez@free•fr>,
Mauro Carvalho Chehab <mchehab@kernel•org>,
Thomas Gleixner <tglx@linutronix•de>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre•com>,
kernel-janitors@vger•kernel.org,
LKML <linux-kernel@vger•kernel.org>,
Himanshu Jha <himanshujha199640@gmail•com>
Subject: [PATCH] media: rc: Use devm_platform_ioremap_resource() in tango_ir_probe()
Date: Wed, 18 Sep 2019 12:37:24 +0200 [thread overview]
Message-ID: <04df8450-1b15-55ec-91e7-7d72ffbedac7@web.de> (raw)
From: Markus Elfring <elfring@users•sourceforge.net>
Date: Wed, 18 Sep 2019 12:30:18 +0200
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>
---
drivers/media/rc/tango-ir.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/media/rc/tango-ir.c b/drivers/media/rc/tango-ir.c
index 451ec4e9dcfa..b8eb5bc4d9be 100644
--- a/drivers/media/rc/tango-ir.c
+++ b/drivers/media/rc/tango-ir.c
@@ -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);
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2019-09-18 10:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-18 10:37 Markus Elfring [this message]
2019-09-18 11:00 ` [PATCH] media: rc: Use devm_platform_ioremap_resource() in tango_ir_probe() Måns Rullgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=04df8450-1b15-55ec-91e7-7d72ffbedac7@web.de \
--to=markus.elfring@web$(echo .)de \
--cc=allison@lohutok$(echo .)net \
--cc=bgolaszewski@baylibre$(echo .)com \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=himanshujha199640@gmail$(echo .)com \
--cc=kernel-janitors@vger$(echo .)kernel.org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=mans@mansr$(echo .)com \
--cc=marc.w.gonzalez@free$(echo .)fr \
--cc=mchehab@kernel$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox