Skip to content

Commit d644e0d

Browse files
Yuuoniyvinodkoul
authored andcommitted
phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe
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: f7f50b2 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 3588060 commit d644e0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/phy/motorola/phy-mapphone-mdm6600.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ static int phy_mdm6600_probe(struct platform_device *pdev)
629629
cleanup:
630630
if (error < 0)
631631
phy_mdm6600_device_power_off(ddata);
632-
632+
pm_runtime_disable(ddata->dev);
633+
pm_runtime_dont_use_autosuspend(ddata->dev);
633634
return error;
634635
}
635636

0 commit comments

Comments
 (0)