mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] usb: typec: qcom: check regulator enable status before disabling it
@ 2023-08-24  2:32 Hui Liu via B4 Relay
  2023-08-24  8:36 ` Bryan O'Donoghue
  2023-08-24 14:12 ` Heikki Krogerus
  0 siblings, 2 replies; 9+ messages in thread
From: Hui Liu via B4 Relay @ 2023-08-24  2:32 UTC (permalink / raw)
  To: Bryan O'Donoghue, Guenter Roeck, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Heikki Krogerus, Greg Kroah-Hartman
  Cc: linux-arm-msm, linux-usb, linux-kernel, quic_fenglinw, subbaram, Hui Liu

From: Hui Liu <quic_huliu@quicinc.com>

Check regulator enable status before disabling it to avoid
unbalanced regulator disable warnings.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Fixes: a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver")
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hui Liu <quic_huliu@quicinc.com>
---
Changes in v2:
- Add Fixes tag
- Link to v1: https://lore.kernel.org/r/20230823-qcom-tcpc-v1-1-fa81a09ca056@quicinc.com
---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 }

---
base-commit: bbb9e06d2c6435af9c62074ad7048910eeb2e7bc
change-id: 20230822-qcom-tcpc-d41954ac65fa

Best regards,
-- 
Hui Liu <quic_huliu@quicinc.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-28  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-24  2:32 [PATCH v2] usb: typec: qcom: check regulator enable status before disabling it Hui Liu via B4 Relay
2023-08-24  8:36 ` Bryan O'Donoghue
2023-08-24 14:12 ` Heikki Krogerus
2023-08-24 14:37   ` Bryan O'Donoghue
2023-08-24 14:49   ` Heikki Krogerus
2023-08-25 10:03     ` hui liu
2023-08-25 10:11       ` Bryan O'Donoghue
2023-08-28  5:51         ` hui liu
2023-08-28  9:43           ` Bryan O'Donoghue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®