aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2017-09-07 20:37:07 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-04 15:30:52 -0300
commit52ea79910720c56420f58771b9790e257764e006 (patch)
treec214da0898fbc72eb0cc996f27648cf0588966b6 /drivers/media/rc
parentfcca09edb9f6e406de6014e3f1c2695b15b52abb (diff)
[media] media: rc: gpio-ir-recv: use devm_rc_register_device
Use of devm_rc_register_device simplifies error unwinding. 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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index 77044d664371..ae5f9099c8a6 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -153,10 +153,10 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
if (rc < 0)
return rc;
- rc = rc_register_device(rcdev);
+ rc = devm_rc_register_device(dev, rcdev);
if (rc < 0) {
dev_err(dev, "failed to register rc device (%d)\n", rc);
- goto err_register_rc_device;
+ return rc;
}
platform_set_drvdata(pdev, gpio_dev);
@@ -171,9 +171,6 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
return 0;
err_request_irq:
- rc_unregister_device(rcdev);
- rcdev = NULL;
-err_register_rc_device:
return rc;
}
@@ -182,7 +179,6 @@ 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);
- rc_unregister_device(gpio_dev->rcdev);
return 0;
}

Privacy Policy