summaryrefslogtreecommitdiff
path: root/drivers/phy/motorola/phy-mapphone-mdm6600.c
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-03-01 05:46:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-09 10:05:01 +0300
commit9e00a6e1fd719a4021eb03bd7870e95bae2b4325 (patch)
treec79ddad70882199b064acd52ba3f5d55f9910f4a /drivers/phy/motorola/phy-mapphone-mdm6600.c
parenteb659608e61e3c00216fec2ee48411ad0c4e52b8 (diff)
downloadlinux-9e00a6e1fd719a4021eb03bd7870e95bae2b4325.tar.xz
phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe
[ Upstream commit d644e0d79829b1b9a14beedbdb0dc1256fc3677d ] The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). And use pm_runtime_dont_use_autosuspend() to undo pm_runtime_use_autosuspend() In the PM Runtime docs: Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc. We should do this in error handling. Fixes: f7f50b2a7b05 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220301024615.31899-1-linmq006@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/phy/motorola/phy-mapphone-mdm6600.c')
-rw-r--r--drivers/phy/motorola/phy-mapphone-mdm6600.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
index 5172971f4c36..3cd4d51c247c 100644
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -629,7 +629,8 @@ idle:
cleanup:
if (error < 0)
phy_mdm6600_device_power_off(ddata);
-
+ pm_runtime_disable(ddata->dev);
+ pm_runtime_dont_use_autosuspend(ddata->dev);
return error;
}