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

Commit e6cacf65 authored by Pratham Pratap's avatar Pratham Pratap
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 a1fe213f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -280,6 +280,12 @@ static int msm_hsphy_enable_power(struct msm_hsphy *phy, bool on)
	if (ret)
		dev_err(phy->phy.dev, "Unable unconfig VDD:%d\n",
								ret);
	/* 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");