diff options
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 @@ | |||
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | |||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
13 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
14 | #include <linux/cpufreq.h> | 17 | #include <linux/cpufreq.h> |
15 | #include <linux/err.h> | 18 | #include <linux/err.h> |
@@ -124,12 +127,12 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) | |||
124 | struct device *dev; | 127 | struct device *dev; |
125 | int cpu, ret = 0; | 128 | int cpu, ret = 0; |
126 | 129 | ||
127 | rcu_read_lock(); | 130 | mutex_lock(&dev_opp_list_lock); |
128 | 131 | ||
129 | dev_opp = _find_device_opp(cpu_dev); | 132 | dev_opp = _find_device_opp(cpu_dev); |
130 | if (IS_ERR(dev_opp)) { | 133 | if (IS_ERR(dev_opp)) { |
131 | ret = -EINVAL; | 134 | ret = -EINVAL; |
132 | goto out_rcu_read_unlock; | 135 | goto unlock; |
133 | } | 136 | } |
134 | 137 | ||
135 | for_each_cpu(cpu, cpumask) { | 138 | for_each_cpu(cpu, cpumask) { |
@@ -150,10 +153,10 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask) | |||
150 | continue; | 153 | continue; |
151 | } | 154 | } |
152 | } | 155 | } |
153 | out_rcu_read_unlock: | 156 | unlock: |
154 | rcu_read_unlock(); | 157 | mutex_unlock(&dev_opp_list_lock); |
155 | 158 | ||
156 | return 0; | 159 | return ret; |
157 | } | 160 | } |
158 | EXPORT_SYMBOL_GPL(dev_pm_opp_set_sharing_cpus); | 161 | EXPORT_SYMBOL_GPL(dev_pm_opp_set_sharing_cpus); |
159 | 162 | ||