[PATCH] phy: mediatek: hdmi: use devm clock provider registration

Wentao Liang vulab at iscas.ac.cn
Tue Nov 3 02:42:41 PST 2026


mtk_hdmi_phy_probe() registers the PLL clock provider with the
deprecated of_clk_add_provider(), which takes a reference on the device
node.  The driver has no .remove callback, so neither the node
reference nor the provider registration is ever released; after the
device is unbound, the global provider list still points at the freed
hdmi_phy and at the unregistered clock.

Register the provider with devm_of_clk_add_hw_provider() and
of_clk_hw_simple_get(), matching the sibling MIPI DSI PHY driver, so
that it is removed when the device is unbound.

Fixes: be28b6507c46 ("drm/mediatek: separate hdmi phy to different file")
Cc: stable at vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
---
 drivers/phy/mediatek/phy-mtk-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/mediatek/phy-mtk-hdmi.c b/drivers/phy/mediatek/phy-mtk-hdmi.c
index 52a7d525ff9b..e7ed1b789b34 100644
--- a/drivers/phy/mediatek/phy-mtk-hdmi.c
+++ b/drivers/phy/mediatek/phy-mtk-hdmi.c
@@ -178,8 +178,8 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	return of_clk_add_provider(dev->of_node, of_clk_src_simple_get,
-				   hdmi_phy->pll);
+	return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
+					   &hdmi_phy->pll_hw);
 }
 
 static const struct of_device_id mtk_hdmi_phy_match[] = {
-- 
2.34.1




More information about the linux-phy mailing list