diff options
| author | Can Peng <pengcan@kylinos.cn> | 2026-07-18 17:00:54 +0800 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-07-20 16:25:58 +0530 |
| commit | 97bed336f6a25c9d1115ca95e3aa00e05c3bc271 (patch) | |
| tree | a2a6ac4ab4e534f6df2d272dc761ee3277d884d1 | |
| parent | f40b0241f3a382e99c14de2f28f14a44973407c1 (diff) | |
| download | linux-97bed336f6a25c9d1115ca95e3aa00e05c3bc271.tar.gz linux-97bed336f6a25c9d1115ca95e3aa00e05c3bc271.zip | |
phy: starfive: Fix runtime PM cleanup in JH7110 DPHY RX probe
stf_dphy_probe() enables runtime PM before registering the PHY provider.
If devm_of_phy_provider_register() 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: f8aa660841bc ("phy: starfive: Add mipi dphy rx support")
Signed-off-by: Can Peng <pengcan@kylinos.cn>
Reviewed-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Link: https://patch.msgid.link/20260718090054.444513-3-pengcan@kylinos.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
| -rw-r--r-- | drivers/phy/starfive/phy-jh7110-dphy-rx.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/phy/starfive/phy-jh7110-dphy-rx.c b/drivers/phy/starfive/phy-jh7110-dphy-rx.c index 0b039e1f71c5..d06f21ad6332 100644 --- a/drivers/phy/starfive/phy-jh7110-dphy-rx.c +++ b/drivers/phy/starfive/phy-jh7110-dphy-rx.c @@ -150,6 +150,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) @@ -190,7 +191,9 @@ static int stf_dphy_probe(struct platform_device *pdev) return PTR_ERR(dphy->phy); } - pm_runtime_enable(&pdev->dev); + ret = devm_pm_runtime_enable(&pdev->dev); + if (ret) + return ret; phy_set_drvdata(dphy->phy, dphy); phy_provider = devm_of_phy_provider_register(&pdev->dev, |
