Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 026280fc authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: phy: snps: Return error if driver fails to enable power



Currently driver is not returning any error from the error
handling path if driver fails to enable power for PHY.
This patch adds a check and returns error if the driver
actually fails to set_voltage or fails to enable a particular
regulator.

Change-Id: I5427690602b6152151adee71c6388ce836ab90c6
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent d948568a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -275,6 +275,12 @@ static int msm_hsphy_enable_power(struct msm_hsphy *phy, bool on)
	ret = regulator_set_load(phy->vdd, 0);
	if (ret < 0)
		dev_err(phy->phy.dev, "Unable to set LPM of vdd\n");
	/* Return from here based on power_enabled. If it is not set
	 * then return -EINVAL since either set_voltage or
	 * regulator_enable failed
	 */
	if (!phy->power_enabled)
		return -EINVAL;
err_vdd:
	phy->power_enabled = false;
	dev_dbg(phy->phy.dev, "HSUSB PHY's regulators are turned OFF.\n");