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:
Uwe Kleine-König 2023-10-26 12:18:18 +02:00 committed by Hans Verkuil
parent 7d21a2df45
commit 12be815fbf

View File

@ -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,