aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJean Pihet <j-pihet@ti.com>2011-08-25 09:35:20 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-08-25 09:35:20 -0400
commit4a31a33425a1eb92f6a0b9846f081842268361c8 (patch)
treec31af2adb3722cdb4bfb874eb2b6669a830edaf2 /kernel
parentcc74998618a66d34651c784dd02412614c3e81cc (diff)
PM QoS: Code reorganization
Move around the PM QoS misc devices management code for better readability. Signed-off-by: Jean Pihet <j-pihet@ti.com> Acked-by: markgross <markgross@thegnar.org> Reviewed-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/qos.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index aa52c44e6080..788c4cfe0cdb 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -188,28 +188,6 @@ static void update_target(struct pm_qos_object *o, struct plist_node *node,
188 NULL); 188 NULL);
189} 189}
190 190
191static int register_pm_qos_misc(struct pm_qos_object *qos)
192{
193 qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
194 qos->pm_qos_power_miscdev.name = qos->name;
195 qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
196
197 return misc_register(&qos->pm_qos_power_miscdev);
198}
199
200static int find_pm_qos_object_by_minor(int minor)
201{
202 int pm_qos_class;
203
204 for (pm_qos_class = 0;
205 pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
206 if (minor ==
207 pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
208 return pm_qos_class;
209 }
210 return -1;
211}
212
213/** 191/**
214 * pm_qos_request - returns current system wide qos expectation 192 * pm_qos_request - returns current system wide qos expectation
215 * @pm_qos_class: identification of which qos value is requested 193 * @pm_qos_class: identification of which qos value is requested
@@ -362,6 +340,29 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier)
362} 340}
363EXPORT_SYMBOL_GPL(pm_qos_remove_notifier); 341EXPORT_SYMBOL_GPL(pm_qos_remove_notifier);
364 342
343/* User space interface to PM QoS classes via misc devices */
344static int register_pm_qos_misc(struct pm_qos_object *qos)
345{
346 qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
347 qos->pm_qos_power_miscdev.name = qos->name;
348 qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
349
350 return misc_register(&qos->pm_qos_power_miscdev);
351}
352
353static int find_pm_qos_object_by_minor(int minor)
354{
355 int pm_qos_class;
356
357 for (pm_qos_class = 0;
358 pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
359 if (minor ==
360 pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
361 return pm_qos_class;
362 }
363 return -1;
364}
365
365static int pm_qos_power_open(struct inode *inode, struct file *filp) 366static int pm_qos_power_open(struct inode *inode, struct file *filp)
366{ 367{
367 long pm_qos_class; 368 long pm_qos_class;