Skip to contentSkip to conversation

clk: mediatek: mt6735-imgsys: 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-imgsys: Publish the OF module alias

The MT6735 imgsys driver is a separately selectable tristate driver. Its OF table is registered with the platform bus, but is not published for module autoloading. Loading the main MT6735 clock driver does not load the separate imgsys module.

Publish the existing OF match table.

Fixes 0bd9b1211f74 ("clk: mediatek: Add drivers for MT6735 syscon clock and reset controllers")
---
 drivers/clk/mediatek/clk-mt6735-imgsys.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/mediatek/clk-mt6735-imgsys.c +1 -0
index c564f8f..813241d 100644
@@ -41,6 +41,7 @@ static const struct of_device_id of_match_mt6735_imgsys[] = {
 	{ .compatible = "mediatek,mt6735-imgsys", .data = &imgsys_clks },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, of_match_mt6735_imgsys);
 
 static struct platform_driver clk_mt6735_imgsys = {
 	.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] The patch adds MODULE_DEVICE_TABLE to the MT6735 imgsys driver to enable module autoloading, but fails to fix the identical missing module alias issue in the MT6735 mfgcfg driver introduced in the same commit. --

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

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

This commit adds the MODULE_DEVICE_TABLE macro to the MT6735 imgsys driver to publish the OF match table. This enables module autoloading when the driver is built as a separately selectable tristate driver.

drivers/clk/mediatek/clk-mt6735-imgsys.c static const struct of_device_id of_match_mt6735_imgsys[] = { · line 44

Quoted 9 lines
drivers/clk/mediatek/clk-mt6735-imgsys.c +1 -0
index c564f8f724324..813241d526cf4 100644
@@ -41,6 +41,7 @@ static const struct of_device_id of_match_mt6735_imgsys[] = {
 	{ .compatible = "mediatek,mt6735-imgsys", .data = &imgsys_clks },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, of_match_mt6735_imgsys);

[Severity: High]
This is a pre-existing issue, but since this patch fixes the missing module autoloading introduced in commit 0bd9b1211f74, should it also fix the identical issue in the MT6735 mfgcfg driver that was added in the same commit?

Without a similar MODULE_DEVICE_TABLE(of, of_match_mt6735_mfgcfg) declaration, the clk-mt6735-mfgcfg driver will fail to automatically load when built as a module, which can break dependent subsystems like the GPU and media blocks that rely on these clocks:

drivers/clk/mediatek/clk-mt6735-mfgcfg.c:

static const struct of_device_id of_match_mt6735_mfgcfg[] = {
	{ .compatible = "mediatek,mt6735-mfgcfg", .data = &mfgcfg_clks },
	{ /* sentinel */ }
};

/* Missing MODULE_DEVICE_TABLE(of, of_match_mt6735_mfgcfg); */

static struct platform_driver clk_mt6735_mfgcfg = {

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