diff options
author | Sudeep Holla <Sudeep.Holla@arm.com> | 2017-10-12 06:32:23 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-10-13 18:49:41 -0400 |
commit | 9867999f3a85b52f96ef05fca00cc8128eed01ce (patch) | |
tree | 2814b3e2b870950469b7c9f4d7296e07f2782c92 /drivers/opp | |
parent | 604a7aeb4325b8ecb23df163c89fc12248302a4e (diff) |
PM / OPP: add missing of_node_put() for of_get_cpu_node()
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
fall back to of_get_cpu_node() if called if CPUs are not registered
yet.
Add the missing of_node_put() for the CPU device nodes. Also go back
to using of_cpu_device_node_get() in dev_pm_opp_of_get_sharing_cpus()
to avoid scanning the device tree again.
Acked-by: Viresh Kumar <vireshk@kernel.org>
Fixes: 762792913f8c (PM / OPP: Fix get sharing CPUs when hotplug is used)
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/opp')
-rw-r--r-- | drivers/opp/of.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 87509cb69f79..cb716aa2f44b 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/of.h> | 19 | #include <linux/of_device.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/export.h> | 21 | #include <linux/export.h> |
22 | 22 | ||
@@ -604,7 +604,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, | |||
604 | if (cpu == cpu_dev->id) | 604 | if (cpu == cpu_dev->id) |
605 | continue; | 605 | continue; |
606 | 606 | ||
607 | cpu_np = of_get_cpu_node(cpu, NULL); | 607 | cpu_np = of_cpu_device_node_get(cpu); |
608 | if (!cpu_np) { | 608 | if (!cpu_np) { |
609 | dev_err(cpu_dev, "%s: failed to get cpu%d node\n", | 609 | dev_err(cpu_dev, "%s: failed to get cpu%d node\n", |
610 | __func__, cpu); | 610 | __func__, cpu); |
@@ -614,6 +614,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, | |||
614 | 614 | ||
615 | /* Get OPP descriptor node */ | 615 | /* Get OPP descriptor node */ |
616 | tmp_np = _opp_of_get_opp_desc_node(cpu_np); | 616 | tmp_np = _opp_of_get_opp_desc_node(cpu_np); |
617 | of_node_put(cpu_np); | ||
617 | if (!tmp_np) { | 618 | if (!tmp_np) { |
618 | pr_err("%pOF: Couldn't find opp node\n", cpu_np); | 619 | pr_err("%pOF: Couldn't find opp node\n", cpu_np); |
619 | ret = -ENOENT; | 620 | ret = -ENOENT; |