summaryrefslogtreecommitdiff
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2017-09-08 02:38:20 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-04 22:03:18 +0300
commit1a2a60b1af1293e8ee7780691ef90a8aa68991c1 (patch)
tree69ab10472b117db66f1fbcc5bc0960d190ed27db /drivers/media/rc
parent375929f9f48356e862789c72ddc1175d89866f44 (diff)
downloadlinux-1a2a60b1af1293e8ee7780691ef90a8aa68991c1.tar.xz
[media] media: rc: gpio-ir-recv: use devm_request_irq
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> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/gpio-ir-recv.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index d82ddf906695..fe0dd2443af0 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -161,24 +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), 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;
+ 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);
}
#ifdef CONFIG_PM
@@ -216,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),