summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-12-15 13:34:45 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-22 11:33:17 +0530
commit546bfe22844d461f838a2ec093f7d97e7bacff15 (patch)
tree8bf4bb4616f0257290b50be91a0856e98e668b2e /kernel
parent1a24e0399b3011d25ac3448cead470947db63202 (diff)
PM QoS: Simplify PM QoS expansion/merge
- Replace class ID #define with enumeration - Loop through PM QoS objects during initialization (rather than initializing them one-by-one) Change-Id: I185b700b52c752c62e7550fe739adc498fc989ef Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/70603 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Antti Miettinen <amiettinen@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/pm_qos_params.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index 37f05d0f0793..d6a47e480f7a 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -459,21 +459,18 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
static int __init pm_qos_power_init(void)
{
int ret = 0;
+ int i;
- ret = register_pm_qos_misc(&cpu_dma_pm_qos);
- if (ret < 0) {
- printk(KERN_ERR "pm_qos_param: cpu_dma_latency setup failed\n");
- return ret;
- }
- ret = register_pm_qos_misc(&network_lat_pm_qos);
- if (ret < 0) {
- printk(KERN_ERR "pm_qos_param: network_latency setup failed\n");
- return ret;
+ BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES);
+
+ for (i = 1; i < PM_QOS_NUM_CLASSES; i++) {
+ ret = register_pm_qos_misc(pm_qos_array[i]);
+ if (ret < 0) {
+ printk(KERN_ERR "pm_qos_param: %s setup failed\n",
+ pm_qos_array[i]->name);
+ return ret;
+ }
}
- ret = register_pm_qos_misc(&network_throughput_pm_qos);
- if (ret < 0)
- printk(KERN_ERR
- "pm_qos_param: network_throughput setup failed\n");
return ret;
}