Skip to contentSkip to conversation

clk: mediatek: mt6735-mfgcfg: Publish the OF module alias

PATCH New hpp.iscas 2 participants 2 messages Sep 5

Subsystems (3)
lore
Share & tools
lore

hpp.iscas

author
#0 lore raw

PATCH 1/1 clk: mediatek: mt6735-mfgcfg: Publish the OF module alias

The MT6735 mfgcfg driver is built as an independent module when its tristate option is m. Its platform-driver match table is not published for OF modalias matching.

Publish the existing table while retaining the clock and reset setup.

Fixes 0bd9b1211f74 ("clk: mediatek: Add drivers for MT6735 syscon clock and reset controllers")
---
 drivers/clk/mediatek/clk-mt6735-mfgcfg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/mediatek/clk-mt6735-mfgcfg.c +1 -0
index 1f5aedd..8a18ee2 100644
@@ -45,6 +45,7 @@ static const struct of_device_id of_match_mt6735_mfgcfg[] = {
 	{ .compatible = "mediatek,mt6735-mfgcfg", .data = &mfgcfg_clks },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, of_match_mt6735_mfgcfg);
 
 static struct platform_driver clk_mt6735_mfgcfg = {
 	.probe = mtk_clk_simple_probe,
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Incomplete fix: missing MODULE_DEVICE_TABLE in clk-mt6735-imgsys --

commit cac832a79fbea2def985b765c45556612cbb95cb
Author: hpp.iscas <[email protected]>

clk: mediatek: mt6735-mfgcfg: Publish the OF module alias

This commit fixes module auto-loading for the MT6735 mfgcfg driver by publishing its OF match table. The driver was built as a module but lacked the module alias, preventing auto-loading.

drivers/clk/mediatek/clk-mt6735-mfgcfg.c static const struct of_device_id of_match_mt6735_mfgcfg[] = { · line 48

Quoted 9 lines
drivers/clk/mediatek/clk-mt6735-mfgcfg.c +1 -0
index 1f5aedddf209d..8a18ee244a4de 100644
@@ -45,6 +45,7 @@ static const struct of_device_id of_match_mt6735_mfgcfg[] = {
 	{ .compatible = "mediatek,mt6735-mfgcfg", .data = &mfgcfg_clks },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, of_match_mt6735_mfgcfg);

[Severity: High]
This is a pre-existing issue, but does this fix need to be applied to other drivers introduced in commit 0bd9b1211f74 as well?

Looking at drivers/clk/mediatek/clk-mt6735-imgsys.c, the clk_mt6735_imgsys driver is also a tristate module with an OF match table, but it appears to be missing the MODULE_DEVICE_TABLE declaration:

static const struct of_device_id of_match_mt6735_imgsys[] = {
	{ .compatible = "mediatek,mt6735-imgsys", .data = &imgsys_clks },
	{ /* sentinel */ }
};
static struct platform_driver clk_mt6735_imgsys = {
	.probe = mtk_clk_simple_probe,
	.remove = mtk_clk_simple_remove,
	.driver = {
		.name = "clk-mt6735-imgsys",
		.of_match_table = of_match_mt6735_imgsys,
	},
};

Without the table being exported, udev fails to auto-load the imgsys driver on boot, which causes dependent imaging subsystems to fail to probe. Could we include the missing MODULE_DEVICE_TABLE for clk-mt6735-imgsys in this patch or a follow-up?

Quoted 3 lines
drivers/clk/mediatek/clk-mt6735-mfgcfg.c +0 -0
 static struct platform_driver clk_mt6735_mfgcfg = {
 	.probe = mtk_clk_simple_probe,

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1