diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2008-05-20 13:16:33 -0400 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2008-07-02 17:06:24 -0400 |
| commit | db26e64dc3f0d51c4db1a625c248a81f7850eee9 (patch) | |
| tree | 52d748b63a3e9e5f8b385737641acc8640711d28 /kernel | |
| parent | b691750098f830b748540cd955f5ac56545bab25 (diff) | |
pm_qos_params: BKL pushdown
[jmc: added <linux/smp_lock.h>]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/pm_qos_params.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index 0afe32be4c85..8cb757026386 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | #include <linux/pm_qos_params.h> | 30 | #include <linux/pm_qos_params.h> |
| 31 | #include <linux/sched.h> | 31 | #include <linux/sched.h> |
| 32 | #include <linux/smp_lock.h> | ||
| 32 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
| 33 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
| 34 | #include <linux/time.h> | 35 | #include <linux/time.h> |
| @@ -358,15 +359,19 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp) | |||
| 358 | int ret; | 359 | int ret; |
| 359 | long pm_qos_class; | 360 | long pm_qos_class; |
| 360 | 361 | ||
| 362 | lock_kernel(); | ||
| 361 | pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); | 363 | pm_qos_class = find_pm_qos_object_by_minor(iminor(inode)); |
| 362 | if (pm_qos_class >= 0) { | 364 | if (pm_qos_class >= 0) { |
| 363 | filp->private_data = (void *)pm_qos_class; | 365 | filp->private_data = (void *)pm_qos_class; |
| 364 | sprintf(name, "process_%d", current->pid); | 366 | sprintf(name, "process_%d", current->pid); |
| 365 | ret = pm_qos_add_requirement(pm_qos_class, name, | 367 | ret = pm_qos_add_requirement(pm_qos_class, name, |
| 366 | PM_QOS_DEFAULT_VALUE); | 368 | PM_QOS_DEFAULT_VALUE); |
| 367 | if (ret >= 0) | 369 | if (ret >= 0) { |
| 370 | unlock_kernel(); | ||
| 368 | return 0; | 371 | return 0; |
| 372 | } | ||
| 369 | } | 373 | } |
| 374 | unlock_kernel(); | ||
| 370 | 375 | ||
| 371 | return -EPERM; | 376 | return -EPERM; |
| 372 | } | 377 | } |
