media: meson-ir-tx: Convert to use devm_rc_register_device()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 26 Oct 2023 10:18:18 +0000 (12:18 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 16 Nov 2023 12:56:47 +0000 (13:56 +0100)
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>
drivers/media/rc/meson-ir-tx.c

index 6355b79893fb258d08452110de78576c49d3df94..dab548dc63027b21c48fe08e6aaa192daef83921 100644 (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,