From: Ladislav Michl <ladis@linux-mips.org>
To: linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sean Young <sean@mess.org>, Andi Shyti <andi.shyti@samsung.com>
Subject: [PATCH v2 07/10] media: rc: gpio-ir-recv: use devm_request_irq
Date: Fri, 8 Sep 2017 01:38:20 +0200 [thread overview]
Message-ID: <20170907233820.nfve3zfuiu2bhwvu@lenoch> (raw)
In-Reply-To: <20170907233355.bv3hsv3rfhcx52i3@lenoch>
Use of devm_request_irq simplifies error unwinding and as
free_irq was the last user of driver remove function,
remove it too.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
Changes:
-v2: rebased to current linux.git
drivers/media/rc/gpio-ir-recv.c | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index 110276d49495..1d115f8531ba 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -161,25 +161,10 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gpio_dev);
- rc = request_irq(gpio_to_irq(pdata->gpio_nr),
+ return devm_request_irq(dev, gpio_to_irq(pdata->gpio_nr),
gpio_ir_recv_irq,
- IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
- "gpio-ir-recv-irq", gpio_dev);
- if (rc < 0)
- goto err_request_irq;
-
- return 0;
-
-err_request_irq:
- return rc;
-}
-
-static int gpio_ir_recv_remove(struct platform_device *pdev)
-{
- struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
-
- free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev);
- return 0;
+ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+ "gpio-ir-recv-irq", gpio_dev);
}
#ifdef CONFIG_PM
@@ -217,7 +202,6 @@ static const struct dev_pm_ops gpio_ir_recv_pm_ops = {
static struct platform_driver gpio_ir_recv_driver = {
.probe = gpio_ir_recv_probe,
- .remove = gpio_ir_recv_remove,
.driver = {
.name = GPIO_IR_DRIVER_NAME,
.of_match_table = of_match_ptr(gpio_ir_recv_of_match),
--
2.11.0
next prev parent reply other threads:[~2017-09-07 23:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170907233401epcas4p4424e892b32d469233705af5014e20604@epcas4p4.samsung.com>
2017-09-07 23:33 ` [PATCH v2 00/10] media: rc: gpio-ir-recv: driver update Ladislav Michl
2017-09-07 23:34 ` [PATCH v2 01/10] media: rc: gpio-ir-recv: use helper vaiable to acess device info Ladislav Michl
2017-09-07 23:35 ` [PATCH v2 02/10] media: rc: gpio-ir-recv: use devm_kzalloc Ladislav Michl
2017-09-07 23:36 ` [PATCH v2 03/10] media: rc: gpio-ir-recv: use devm_rc_allocate_device Ladislav Michl
2017-09-07 23:36 ` [PATCH v2 04/10] media: rc: gpio-ir-recv: use devm_gpio_request_one Ladislav Michl
2017-09-07 23:37 ` [PATCH v2 05/10] media: rc: gpio-ir-recv: use devm_rc_register_device Ladislav Michl
2017-09-07 23:37 ` [PATCH v2 06/10] media: rc: gpio-ir-recv: do not allow threaded interrupt handler Ladislav Michl
2017-09-07 23:38 ` Ladislav Michl [this message]
2017-09-07 23:39 ` [PATCH v2 08/10] media: rc: gpio-ir-recv: use KBUILD_MODNAME Ladislav Michl
2017-09-07 23:39 ` [PATCH v2 09/10] media: rc: gpio-ir-recv: remove gpio_ir_recv_platform_data Ladislav Michl
2017-09-07 23:41 ` [PATCH v2 10/10] media: rc: gpio-ir-recv: use gpiolib API Ladislav Michl
2017-09-08 2:21 ` [PATCH v2 00/10] media: rc: gpio-ir-recv: driver update Andi Shyti
2017-09-08 8:16 ` Ladislav Michl
2017-09-11 2:58 ` Andi Shyti
2017-09-11 7:13 ` Ladislav Michl
2017-09-15 21:56 ` Ladislav Michl
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=20170907233820.nfve3zfuiu2bhwvu@lenoch \
--to=ladis@linux-mips.org \
--cc=andi.shyti@samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sean@mess.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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