From: jean.pihet@newoldbits.com
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Kevin Hilman <khilman@ti.com>,
markgross@thegnar.org,
Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
linux-omap@vger.ke
Cc: Jean Pihet <j-pihet@ti.com>
Subject: [PATCH 3/7] PM QoS: code re-organization
Date: Wed, 17 Aug 2011 21:39:21 +0200 [thread overview]
Message-ID: <1313609965-6568-4-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1313609965-6568-1-git-send-email-j-pihet@ti.com>
From: Jean Pihet <j-pihet@ti.com>
Move around the PM QoS misc devices management code
for better readability.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
kernel/power/qos.c | 45 +++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index aa52c44..788c4cf 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,
NULL);
}
-static int register_pm_qos_misc(struct pm_qos_object *qos)
-{
- qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
- qos->pm_qos_power_miscdev.name = qos->name;
- qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
-
- return misc_register(&qos->pm_qos_power_miscdev);
-}
-
-static int find_pm_qos_object_by_minor(int minor)
-{
- int pm_qos_class;
-
- for (pm_qos_class = 0;
- pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
- if (minor ==
- pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
- return pm_qos_class;
- }
- return -1;
-}
-
/**
* pm_qos_request - returns current system wide qos expectation
* @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)
}
EXPORT_SYMBOL_GPL(pm_qos_remove_notifier);
+/* User space interface to PM QoS classes via misc devices */
+static int register_pm_qos_misc(struct pm_qos_object *qos)
+{
+ qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
+ qos->pm_qos_power_miscdev.name = qos->name;
+ qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
+
+ return misc_register(&qos->pm_qos_power_miscdev);
+}
+
+static int find_pm_qos_object_by_minor(int minor)
+{
+ int pm_qos_class;
+
+ for (pm_qos_class = 0;
+ pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
+ if (minor ==
+ pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
+ return pm_qos_class;
+ }
+ return -1;
+}
+
static int pm_qos_power_open(struct inode *inode, struct file *filp)
{
long pm_qos_class;
--
1.7.4.1
next prev parent reply other threads:[~2011-08-17 19:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 19:39 [PATCH v6 0/7] PM QoS: add a per-device latency constraints framework jean.pihet
2011-08-17 19:39 ` [PATCH 1/7] PM QoS: move and rename the implementation files jean.pihet
2011-08-17 19:39 ` [PATCH 2/7] PM QoS: minor clean-ups jean.pihet
2011-08-17 19:39 ` jean.pihet [this message]
2011-08-17 19:39 ` [PATCH 4/7] PM QoS: re-organize data structs jean.pihet
2011-08-17 19:39 ` [PATCH 5/7] PM QoS: generalize and export the constraints management code jean.pihet
2011-08-17 19:39 ` [PATCH 6/7] PM QoS: implement the per-device PM QoS constraints jean.pihet
2011-08-17 19:39 ` [PATCH 7/7] PM QoS: add a global notification mechanism for the device constraints jean.pihet
2011-08-18 7:59 ` [PATCH v6 0/7] PM QoS: add a per-device latency constraints framework Rafael J. Wysocki
2011-08-22 17:56 ` Kevin Hilman
2011-08-22 18:53 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313609965-6568-4-git-send-email-j-pihet@ti.com \
--to=jean.pihet@newoldbits.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=j-pihet@ti.com \
--cc=khilman@ti.com \
--cc=linux-omap@vger.ke \
--cc=linux-pm@lists.linux-foundation.org \
--cc=markgross@thegnar.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox