linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / OPP: use of_cpu_device_node_get() instead of of_get_cpu_node()
@ 2017-10-10 10:48 Sudeep Holla
  2017-10-10 11:45 ` Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Sudeep Holla @ 2017-10-10 10:48 UTC (permalink / raw)
  To: linux-pm, Viresh Kumar
  Cc: Sudeep Holla, Viresh Kumar, Nishanth Menon, Stephen Boyd,
	Rafael J. Wysocki

Commit 762792913f8c ("PM / OPP: Fix get sharing CPUs when hotplug is used")
moved away from using cpu_dev->of_node because of some limitations.
However commit 7467c9d95989 ("of: return of_get_cpu_node from
of_cpu_device_node_get if CPUs are not registered") added support to
falls back to of_get_cpu_node if called if CPUs are not registered yet.

This patch moves back to use of_cpu_device_node_get in
dev_pm_opp_of_get_sharing_cpus to avoid scanning the device tree again.
It also adds the missing of_node_put for the CPU device nodes.

Cc: Viresh Kumar <vireshk@kernel.org>
Cc: Nishanth Menon <nm@ti.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Fixes: 762792913f8c ("PM / OPP: Fix get sharing CPUs when hotplug is used")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/base/power/opp/of.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c
index 0b718886479b..3505193043fe 100644
--- a/drivers/base/power/opp/of.c
+++ b/drivers/base/power/opp/of.c
@@ -603,13 +603,14 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev,
 		if (cpu == cpu_dev->id)
 			continue;

-		cpu_np = of_get_cpu_node(cpu, NULL);
+		cpu_np = of_cpu_device_node_get(cpu);
 		if (!cpu_np) {
 			dev_err(cpu_dev, "%s: failed to get cpu%d node\n",
 				__func__, cpu);
 			ret = -ENOENT;
 			goto put_cpu_node;
 		}
+		of_node_put(cpu_np);

 		/* Get OPP descriptor node */
 		tmp_np = _opp_of_get_opp_desc_node(cpu_np);
--
2.7.4

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-10-12 20:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-10 10:48 [PATCH] PM / OPP: use of_cpu_device_node_get() instead of of_get_cpu_node() Sudeep Holla
2017-10-10 11:45 ` Viresh Kumar
2017-10-10 12:39   ` Sudeep Holla
2017-10-10 15:54     ` Sudeep Holla
2017-10-10 17:12       ` Rafael J. Wysocki
2017-10-10 17:13         ` Rafael J. Wysocki
2017-10-10 17:20           ` Sudeep Holla
2017-10-11  4:23     ` Viresh Kumar
2017-10-11 10:11 ` [PATCH v2] PM / OPP: add missing of_node_put() for of_get_cpu_node() Sudeep Holla
2017-10-11 10:21   ` Viresh Kumar
2017-10-11 10:35     ` Sudeep Holla
2017-10-11 10:36       ` Viresh Kumar
2017-10-11 11:21         ` Sudeep Holla
2017-10-11 20:20   ` Stephen Boyd
2017-10-12  8:50     ` Sudeep Holla
2017-10-12 10:32 ` [PATCH v3] " Sudeep Holla
2017-10-12 20:58   ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).