Skip to content

Commit 92c959b

Browse files
hkallweitpH5
authored andcommitted
reset: renesas: Fix Runtime PM usage
If pm_runtime_resume_and_get() fails then it returns w/o the RPM usage counter being incremented. In this case call pm_runtime_put() in remove() will result in a usage counter imbalance. Therefore check the return code of pm_runtime_resume_and_get() and bail out in case of error. Fixes: bee0855 ("reset: renesas: Add RZ/G2L usbphy control driver") Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Zabel <[email protected]>
1 parent 69125b4 commit 92c959b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/reset/reset-rzg2l-usbphy-ctrl.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
137137
dev_set_drvdata(dev, priv);
138138

139139
pm_runtime_enable(&pdev->dev);
140-
pm_runtime_resume_and_get(&pdev->dev);
140+
error = pm_runtime_resume_and_get(&pdev->dev);
141+
if (error < 0) {
142+
pm_runtime_disable(&pdev->dev);
143+
reset_control_assert(priv->rstc);
144+
return dev_err_probe(&pdev->dev, error, "pm_runtime_resume_and_get failed");
145+
}
141146

142147
/* put pll and phy into reset state */
143148
spin_lock_irqsave(&priv->lock, flags);

0 commit comments

Comments
 (0)