Skip to content

Commit f2004e8

Browse files
jhovoldgregkh
authored andcommitted
usb: typec: qcom-pmic: fix pdphy start() error handling
Move disabling of the vdd-pdphy supply to the start() function which enabled it for symmetry and to make sure that it is disabled as intended in all error paths of pmic_typec_pdphy_reset() (i.e. not just when qcom_pmic_typec_pdphy_enable() fails). Cc: [email protected] # Not needed in any stable release, just a minor bugfix Fixes: a4422ff ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver") Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d80eee9 commit f2004e8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,8 @@ static int qcom_pmic_typec_pdphy_enable(struct pmic_typec_pdphy *pmic_typec_pdph
475475

476476
qcom_pmic_typec_pdphy_reset_off(pmic_typec_pdphy);
477477
done:
478-
if (ret) {
479-
regulator_disable(pmic_typec_pdphy->vdd_pdphy);
478+
if (ret)
480479
dev_err(dev, "pdphy_enable fail %d\n", ret);
481-
}
482480

483481
return ret;
484482
}
@@ -524,12 +522,17 @@ static int qcom_pmic_typec_pdphy_start(struct pmic_typec *tcpm,
524522

525523
ret = pmic_typec_pdphy_reset(pmic_typec_pdphy);
526524
if (ret)
527-
return ret;
525+
goto err_disable_vdd_pdhy;
528526

529527
for (i = 0; i < pmic_typec_pdphy->nr_irqs; i++)
530528
enable_irq(pmic_typec_pdphy->irq_data[i].irq);
531529

532530
return 0;
531+
532+
err_disable_vdd_pdhy:
533+
regulator_disable(pmic_typec_pdphy->vdd_pdphy);
534+
535+
return ret;
533536
}
534537

535538
static void qcom_pmic_typec_pdphy_stop(struct pmic_typec *tcpm)

0 commit comments

Comments
 (0)