diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-10-22 19:09:00 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-10-22 19:09:00 -0400 |
commit | 021c870ba4ab4bc9a23d5db4e324f50f26d8ab24 (patch) | |
tree | b6e928a4d20ffab16297e0d44de59ee20aaf9c6d | |
parent | 5efbe4279f959a3f5ed26adf5f05cb78dd1ffa7e (diff) |
PM / QoS: Prepare struct dev_pm_qos_request for more request types
The subsequent patches will use struct dev_pm_qos_request for
representing both latency requests and flags requests. To make that
easier, put the node member of struct dev_pm_qos_request (under the
name "pnode") into a union called "data" that will represent the
request's value and list node depending on its type.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: mark gross <markgross@thegnar.org>
-rw-r--r-- | drivers/base/power/qos.c | 6 | ||||
-rw-r--r-- | drivers/base/power/sysfs.c | 2 | ||||
-rw-r--r-- | include/linux/pm_qos.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 40ff1b02a7c5..96d27b821bb8 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c | |||
@@ -90,7 +90,7 @@ static int apply_constraint(struct dev_pm_qos_request *req, | |||
90 | int ret, curr_value; | 90 | int ret, curr_value; |
91 | 91 | ||
92 | ret = pm_qos_update_target(&req->dev->power.qos->latency, | 92 | ret = pm_qos_update_target(&req->dev->power.qos->latency, |
93 | &req->node, action, value); | 93 | &req->data.pnode, action, value); |
94 | 94 | ||
95 | if (ret) { | 95 | if (ret) { |
96 | /* Call the global callbacks if needed */ | 96 | /* Call the global callbacks if needed */ |
@@ -183,7 +183,7 @@ void dev_pm_qos_constraints_destroy(struct device *dev) | |||
183 | 183 | ||
184 | c = &qos->latency; | 184 | c = &qos->latency; |
185 | /* Flush the constraints list for the device */ | 185 | /* Flush the constraints list for the device */ |
186 | plist_for_each_entry_safe(req, tmp, &c->list, node) { | 186 | plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) { |
187 | /* | 187 | /* |
188 | * Update constraints list and call the notification | 188 | * Update constraints list and call the notification |
189 | * callbacks if needed | 189 | * callbacks if needed |
@@ -293,7 +293,7 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req, | |||
293 | mutex_lock(&dev_pm_qos_mtx); | 293 | mutex_lock(&dev_pm_qos_mtx); |
294 | 294 | ||
295 | if (req->dev->power.qos) { | 295 | if (req->dev->power.qos) { |
296 | if (new_value != req->node.prio) | 296 | if (new_value != req->data.pnode.prio) |
297 | ret = apply_constraint(req, PM_QOS_UPDATE_REQ, | 297 | ret = apply_constraint(req, PM_QOS_UPDATE_REQ, |
298 | new_value); | 298 | new_value); |
299 | } else { | 299 | } else { |
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index b91dc6f1e914..54c61ffa2044 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
@@ -221,7 +221,7 @@ static DEVICE_ATTR(autosuspend_delay_ms, 0644, autosuspend_delay_ms_show, | |||
221 | static ssize_t pm_qos_latency_show(struct device *dev, | 221 | static ssize_t pm_qos_latency_show(struct device *dev, |
222 | struct device_attribute *attr, char *buf) | 222 | struct device_attribute *attr, char *buf) |
223 | { | 223 | { |
224 | return sprintf(buf, "%d\n", dev->power.pq_req->node.prio); | 224 | return sprintf(buf, "%d\n", dev->power.pq_req->data.pnode.prio); |
225 | } | 225 | } |
226 | 226 | ||
227 | static ssize_t pm_qos_latency_store(struct device *dev, | 227 | static ssize_t pm_qos_latency_store(struct device *dev, |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 413ada3c7c97..3b9d14964d2b 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -39,7 +39,9 @@ struct pm_qos_flags_request { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | struct dev_pm_qos_request { | 41 | struct dev_pm_qos_request { |
42 | struct plist_node node; | 42 | union { |
43 | struct plist_node pnode; | ||
44 | } data; | ||
43 | struct device *dev; | 45 | struct device *dev; |
44 | }; | 46 | }; |
45 | 47 | ||