]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/mediatek: mtk_hdmi: Convert to module_platform_driver macro
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 15 Apr 2025 10:43:04 +0000 (12:43 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Mon, 21 Apr 2025 12:32:17 +0000 (12:32 +0000)
Now that all of the mtk_hdmi subdrivers are a platform driver on
their own it is possible to remove the custom init/exit functions
in this driver and just use the module_platform_driver() macro.

While at it, also compress struct of_device_id entries and remove
stray commas in mtk_hdmi_driver assignments.

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250415104321.51149-7-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_hdmi.c

index a6d719fa9017c653d5549ee3437af18a1a7b7480..68b1632a2d00eb9b570e94e55a48cc575a2e4f4f 100644 (file)
@@ -1784,25 +1784,7 @@ static struct platform_driver mtk_hdmi_driver = {
                .pm = &mtk_hdmi_pm_ops,
        },
 };
-
-static struct platform_driver * const mtk_hdmi_drivers[] = {
-       &mtk_hdmi_driver,
-};
-
-static int __init mtk_hdmitx_init(void)
-{
-       return platform_register_drivers(mtk_hdmi_drivers,
-                                        ARRAY_SIZE(mtk_hdmi_drivers));
-}
-
-static void __exit mtk_hdmitx_exit(void)
-{
-       platform_unregister_drivers(mtk_hdmi_drivers,
-                                   ARRAY_SIZE(mtk_hdmi_drivers));
-}
-
-module_init(mtk_hdmitx_init);
-module_exit(mtk_hdmitx_exit);
+module_platform_driver(mtk_hdmi_driver);
 
 MODULE_AUTHOR("Jie Qiu <jie.qiu@mediatek.com>");
 MODULE_DESCRIPTION("MediaTek HDMI Driver");