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

Commit 29c41d5c authored by David Collins's avatar David Collins
Browse files

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: default avatarDavid Collins <collinsd@codeaurora.org>
parent 3a4e5978
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
// 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);
	}