summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCan Peng <pengcan@kylinos.cn>2026-07-18 17:00:53 +0800
committerVinod Koul <vkoul@kernel.org>2026-07-20 16:25:58 +0530
commitf40b0241f3a382e99c14de2f28f14a44973407c1 (patch)
treef906be363f22bd0b069db9090fbae68954010c8f
parent9ef4e520912e4966081e276beda628b69aac85dd (diff)
downloadlinux-f40b0241f3a382e99c14de2f28f14a44973407c1.tar.gz
linux-f40b0241f3a382e99c14de2f28f14a44973407c1.zip
phy: starfive: Fix runtime PM cleanup in JH7110 DPHY TX probe
stf_dphy_probe() enables runtime PM before getting the clock and reset controls, creating the PHY and registering the PHY provider. If any of those steps fails, probe returns with runtime PM still enabled. The driver also has no remove callback, so runtime PM is left enabled on driver unbind after a successful probe. Use devm_pm_runtime_enable() so runtime PM is disabled automatically on later probe failures and on driver unbind. Fixes: d3ab79553308 ("phy: starfive: Add mipi dphy tx support") Signed-off-by: Can Peng <pengcan@kylinos.cn> Reviewed-by: Changhuang Liang <changhuang.liang@starfivetech.com> Link: https://patch.msgid.link/20260718090054.444513-2-pengcan@kylinos.cn Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/phy/starfive/phy-jh7110-dphy-tx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/phy/starfive/phy-jh7110-dphy-tx.c b/drivers/phy/starfive/phy-jh7110-dphy-tx.c
index c64d1c91b130..181491a93807 100644
--- a/drivers/phy/starfive/phy-jh7110-dphy-tx.c
+++ b/drivers/phy/starfive/phy-jh7110-dphy-tx.c
@@ -392,6 +392,7 @@ static int stf_dphy_probe(struct platform_device *pdev)
{
struct phy_provider *phy_provider;
struct stf_dphy *dphy;
+ int ret;
dphy = devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL);
if (!dphy)
@@ -406,7 +407,9 @@ static int stf_dphy_probe(struct platform_device *pdev)
if (IS_ERR(dphy->topsys))
return PTR_ERR(dphy->topsys);
- pm_runtime_enable(&pdev->dev);
+ ret = devm_pm_runtime_enable(&pdev->dev);
+ if (ret)
+ return ret;
dphy->txesc_clk = devm_clk_get(&pdev->dev, "txesc");
if (IS_ERR(dphy->txesc_clk))