Add the new system bus frequency pm-qos object for older kernels
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 12 Jan 2010 00:40:14 +0000 (16:40 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 12 Jan 2010 00:40:14 +0000 (16:40 -0800)
This adds the new system_bus_freq_pm_qos for older kernels.
This also fixes a compile warning on possible array out of
bounds access on pm-qos, this was due to the fact that the
pm-qos implementation we had on code was out of synch with
the header we were copying over. This synchs up the array
to what is in linux-next as of linux-next tag next-20100111

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
compat/compat-2.6.25.c

index 3284572..e1a81ae 100644 (file)
@@ -94,12 +94,24 @@ static struct pm_qos_object network_throughput_pm_qos = {
        .comparitor = max_compare
 };
 
+static BLOCKING_NOTIFIER_HEAD(system_bus_freq_notifier);
+static struct pm_qos_object system_bus_freq_pm_qos = {
+       .requirements =
+               {LIST_HEAD_INIT(system_bus_freq_pm_qos.requirements.list)},
+       .notifiers = &system_bus_freq_notifier,
+       .name = "system_bus_freq",
+       .default_value = 0,
+       .target_value = 0,
+       .comparitor = max_compare
+};
+
 
 static struct pm_qos_object *pm_qos_array[] = {
        &null_pm_qos,
        &cpu_dma_pm_qos,
        &network_lat_pm_qos,
-       &network_throughput_pm_qos
+       &network_throughput_pm_qos,
+       &system_bus_freq_pm_qos,
 };
 
 static DEFINE_SPINLOCK(pm_qos_lock);
@@ -408,9 +420,17 @@ int compat_pm_qos_power_init(void)
                return ret;
        }
        ret = register_pm_qos_misc(&network_throughput_pm_qos);
-       if (ret < 0)
+       if (ret < 0) {
                printk(KERN_ERR
                        "pm_qos_param: network_throughput setup failed\n");
+               return ret;
+       }
+       ret = register_pm_qos_misc(&system_bus_freq_pm_qos);
+       if (ret < 0) {
+               printk(KERN_ERR
+                       "pm_qos_param: network_throughput setup failed\n");
+               return ret;
+       }
 
        return ret;
 }