Message ID | 20230823-qcom-tcpc-v1-1-fa81a09ca056@quicinc.com |
---|---|
State | New |
Headers | show |
Series | usb: typec: qcom: check regulator enable status before disabling it | expand |
diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c index bb0b8479d80f..ca616b17b5b6 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c @@ -422,7 +422,8 @@ static int qcom_pmic_typec_pdphy_disable(struct pmic_typec_pdphy *pmic_typec_pdp ret = regmap_write(pmic_typec_pdphy->regmap, pmic_typec_pdphy->base + USB_PDPHY_EN_CONTROL_REG, 0); - regulator_disable(pmic_typec_pdphy->vdd_pdphy); + if (regulator_is_enabled(pmic_typec_pdphy->vdd_pdphy)) + regulator_disable(pmic_typec_pdphy->vdd_pdphy); return ret; }