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: Pratham Pratap <prathampratap@codeaurora.org>
This commit is contained in:
Pratham Pratap 2020-05-19 00:33:19 +05:30 • committed by Gerrit - the friendly Code Review server
commit 026280fcfa

View file

@ -275,6 +275,12 @@ put_vdd_lpm:
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");