]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 1 Mar 2022 02:46:11 +0000 (02:46 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:22:45 +0000 (14:22 +0200)
commit80eb49a2d8a4aa41b5931a3aad0ce4b0fc6d54c6
tree69e992a5bc3c4753c29220864c9e0ffb432be709
parentf583894ee1dcc7ed9bb6f2d06caac98a4350fa90
phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe

BugLink: https://bugs.launchpad.net/bugs/1978234
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/phy/motorola/phy-mapphone-mdm6600.c