diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-11-07 01:30:40 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-11-07 01:30:40 +0100 |
commit | 1ede53f73171722fcf1b5be63bcd64e42d14affc (patch) | |
tree | ae2391cccb97dcb4b09f573572457613d367f1ba /drivers/base/power/opp/cpu.c | |
parent | Merge branches 'acpi-video' and 'acpi-cppc' (diff) | |
parent | PM / OPP: Add opp_rcu_lockdep_assert() to _find_device_opp() (diff) | |
download | linux-1ede53f73171722fcf1b5be63bcd64e42d14affc.tar.xz linux-1ede53f73171722fcf1b5be63bcd64e42d14affc.zip |
Merge branch 'pm-opp'
* pm-opp:
PM / OPP: Add opp_rcu_lockdep_assert() to _find_device_opp()
PM / OPP: Hold dev_opp_list_lock for writers
PM / OPP: Protect updates to list_dev with mutex
PM / OPP: Propagate error properly from dev_pm_opp_set_sharing_cpus()
PM / OPP: Parse all power-supply related bindings together
PM / OPP: Rename routines specific to old bindings with _v1
PM / OPP: Improve print messages with pr_fmt
Diffstat (limited to 'drivers/base/power/opp/cpu.c')
-rw-r--r-- | drivers/base/power/opp/cpu.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/base/power/opp/cpu.c b/drivers/base/power/opp/cpu.c index 7654c5606307..7b445e88a0d5 100644 --- a/drivers/base/power/opp/cpu.c +++ b/drivers/base/power/opp/cpu.c @@ -10,6 +10,9 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/cpu.h> #include <linux/cpufreq.h> #include <linux/err.h> @@ -124,12 +127,12 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) struct device *dev; int cpu, ret = 0; - rcu_read_lock(); + mutex_lock(&dev_opp_list_lock); dev_opp = _find_device_opp(cpu_dev); if (IS_ERR(dev_opp)) { ret = -EINVAL; - goto out_rcu_read_unlock; + goto unlock; } for_each_cpu(cpu, cpumask) { @@ -150,10 +153,10 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) continue; } } -out_rcu_read_unlock: - rcu_read_unlock(); +unlock: + mutex_unlock(&dev_opp_list_lock); - return 0; + return ret; } EXPORT_SYMBOL_GPL(dev_pm_opp_set_sharing_cpus); |