]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/power/qos.c
Merge tag 'docs-5.6' of git://git.lwn.net/linux
[linux.git] / kernel / power / qos.c
index 04e83fdfbe80c016d986adae9fe2fd36bc2ca8d7..83edf8698118628fa72d890d8fd844eeade86366 100644 (file)
@@ -714,8 +714,10 @@ s32 freq_qos_read_value(struct freq_constraints *qos,
  * @req: Constraint request to apply.
  * @action: Action to perform (add/update/remove).
  * @value: Value to assign to the QoS request.
+ *
+ * This is only meant to be called from inside pm_qos, not drivers.
  */
-static int freq_qos_apply(struct freq_qos_request *req,
+int freq_qos_apply(struct freq_qos_request *req,
                          enum pm_qos_req_action action, s32 value)
 {
        int ret;
@@ -814,6 +816,8 @@ EXPORT_SYMBOL_GPL(freq_qos_update_request);
  */
 int freq_qos_remove_request(struct freq_qos_request *req)
 {
+       int ret;
+
        if (!req)
                return -EINVAL;
 
@@ -821,7 +825,11 @@ int freq_qos_remove_request(struct freq_qos_request *req)
                 "%s() called for unknown object\n", __func__))
                return -EINVAL;
 
-       return freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
+       ret = freq_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE);
+       req->qos = NULL;
+       req->type = 0;
+
+       return ret;
 }
 EXPORT_SYMBOL_GPL(freq_qos_remove_request);