Commit 52ea7991 authored by Ladislav Michl's avatar Ladislav Michl Committed by Mauro Carvalho Chehab

[media] media: rc: gpio-ir-recv: use devm_rc_register_device

Use of devm_rc_register_device simplifies error unwinding.
Signed-off-by: default avatarLadislav Michl <ladis@linux-mips.org>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent fcca09ed
...@@ -153,10 +153,10 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) ...@@ -153,10 +153,10 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
if (rc < 0) if (rc < 0)
return rc; return rc;
rc = rc_register_device(rcdev); rc = devm_rc_register_device(dev, rcdev);
if (rc < 0) { if (rc < 0) {
dev_err(dev, "failed to register rc device (%d)\n", rc); dev_err(dev, "failed to register rc device (%d)\n", rc);
goto err_register_rc_device; return rc;
} }
platform_set_drvdata(pdev, gpio_dev); platform_set_drvdata(pdev, gpio_dev);
...@@ -171,9 +171,6 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) ...@@ -171,9 +171,6 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
return 0; return 0;
err_request_irq: err_request_irq:
rc_unregister_device(rcdev);
rcdev = NULL;
err_register_rc_device:
return rc; return rc;
} }
...@@ -182,7 +179,6 @@ static int gpio_ir_recv_remove(struct platform_device *pdev) ...@@ -182,7 +179,6 @@ static int gpio_ir_recv_remove(struct platform_device *pdev)
struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev); free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev);
rc_unregister_device(gpio_dev->rcdev);
return 0; return 0;
} }
......
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