mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
media: meson-ir-tx: Convert to use devm_rc_register_device()
With that the remove callback can go away and also setting driver data becomes superfluous. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
7d21a2df45
commit
12be815fbf
@ -360,25 +360,16 @@ static int __init meson_irtx_probe(struct platform_device *pdev)
|
||||
rc->s_tx_carrier = meson_irtx_set_carrier;
|
||||
rc->s_tx_duty_cycle = meson_irtx_set_duty_cycle;
|
||||
|
||||
ret = rc_register_device(rc);
|
||||
ret = devm_rc_register_device(dev, rc);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "rc_dev registration failed\n");
|
||||
rc_free_device(rc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, rc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void meson_irtx_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct rc_dev *rc = platform_get_drvdata(pdev);
|
||||
|
||||
rc_unregister_device(rc);
|
||||
}
|
||||
|
||||
static const struct of_device_id meson_irtx_dt_match[] = {
|
||||
{
|
||||
.compatible = "amlogic,meson-g12a-ir-tx",
|
||||
@ -388,7 +379,6 @@ static const struct of_device_id meson_irtx_dt_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, meson_irtx_dt_match);
|
||||
|
||||
static struct platform_driver meson_irtx_pd = {
|
||||
.remove_new = meson_irtx_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.of_match_table = meson_irtx_dt_match,
|
||||
|
Loading…
x
Reference in New Issue
Block a user