Skip to content

Commit 9bf03a0

Browse files
jhovoldvinodkoul
authored andcommitted
phy: qcom-qmp-combo: fix init-count imbalance
The init counter is not decremented on initialisation errors, which prevents retrying initialisation and can lead to the runtime suspend callback attempting to disable resources that have never been enabled. Add the missing decrement on initialisation errors so that the counter reflects the state of the device. Fixes: e78f3d1 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Cc: [email protected] # 4.12 Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent ac9a786 commit 9bf03a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-combo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,7 @@ static int qmp_combo_com_init(struct qmp_combo *qmp)
24722472
ret = regulator_bulk_enable(cfg->num_vregs, qmp->vregs);
24732473
if (ret) {
24742474
dev_err(qmp->dev, "failed to enable regulators, err=%d\n", ret);
2475-
goto err_unlock;
2475+
goto err_decrement_count;
24762476
}
24772477

24782478
ret = reset_control_bulk_assert(cfg->num_resets, qmp->resets);
@@ -2522,7 +2522,8 @@ static int qmp_combo_com_init(struct qmp_combo *qmp)
25222522
reset_control_bulk_assert(cfg->num_resets, qmp->resets);
25232523
err_disable_regulators:
25242524
regulator_bulk_disable(cfg->num_vregs, qmp->vregs);
2525-
err_unlock:
2525+
err_decrement_count:
2526+
qmp->init_count--;
25262527
mutex_unlock(&qmp->phy_mutex);
25272528

25282529
return ret;

0 commit comments

Comments
 (0)