From 96f3cd39127e687bc7f2cb2d65f5129eb2428e95 Mon Sep 17 00:00:00 2001 From: David Collins Date: Tue, 14 Jan 2020 18:00:30 -0800 Subject: [PATCH] regulator: rpmh-regulator: support parent supply specification in subnodes Add support for parent supply properties specified in regulator- specific device tree subnodes. This style can be used to avoid false positive circular dependencies in the wait_for_supplier logic. Change-Id: Id9a96e27ea62ef37b4b5bbfb344ee206b439ee3f Signed-off-by: David Collins --- drivers/regulator/rpmh-regulator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/rpmh-regulator.c b/drivers/regulator/rpmh-regulator.c index 73aed2ad4891..5bf670e9b313 100644 --- a/drivers/regulator/rpmh-regulator.c +++ b/drivers/regulator/rpmh-regulator.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */ +/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "%s: " fmt, __func__ @@ -1660,7 +1660,8 @@ static int rpmh_regulator_init_vreg_supply(struct rpmh_vreg *vreg) return -ENOMEM; scnprintf(buf, len, "%s-parent-supply", vreg->rdesc.name); - if (of_find_property(vreg->aggr_vreg->dev->of_node, buf, NULL)) { + if (of_find_property(vreg->aggr_vreg->dev->of_node, buf, NULL) || + of_find_property(vreg->of_node, buf, NULL)) { kfree(buf); len = strlen(vreg->rdesc.name) + 10; @@ -1670,6 +1671,8 @@ static int rpmh_regulator_init_vreg_supply(struct rpmh_vreg *vreg) scnprintf(buf, len, "%s-parent", vreg->rdesc.name); vreg->rdesc.supply_name = buf; + } else if (of_find_property(vreg->of_node, "vin-supply", NULL)) { + vreg->rdesc.supply_name = "vin"; } else { kfree(buf); }