summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorAsutosh Das <asutoshd@codeaurora.org>2017-02-10 09:58:55 +0530
committerAsutosh Das <asutoshd@codeaurora.org>2017-02-17 07:12:00 +0530
commitfd9bba4caa0d21a0569c8bc75876c3dbe0f46c39 (patch)
treeb8958675abc1b62d07aa04d4762e35d68a7380be /drivers/phy
parentc1c02eecad41ac28d788b1db9b0d10ccd8adb7a5 (diff)
phy: qcom-ufs: parse ref-clk details prior to resource request
Do not request a resource if the ref clk regulator details are not defined in ufs phy node. Change-Id: I10eb426d4407388681340cb71fe9e761794dc298 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-qcom-ufs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c
index 6e06fef81849..c3cb57ed6083 100644
--- a/drivers/phy/phy-qcom-ufs.c
+++ b/drivers/phy/phy-qcom-ufs.c
@@ -267,6 +267,14 @@ static int __ufs_qcom_phy_init_vreg(struct phy *phy,
char prop_name[MAX_PROP_NAME];
+ if (dev->of_node) {
+ snprintf(prop_name, MAX_PROP_NAME, "%s-supply", name);
+ if (!of_parse_phandle(dev->of_node, prop_name, 0)) {
+ dev_dbg(dev, "No vreg data found for %s\n", prop_name);
+ return optional ? err : -ENODATA;
+ }
+ }
+
vreg->name = kstrdup(name, GFP_KERNEL);
if (!vreg->name) {
err = -ENOMEM;