PM / QOS: Pass request type to dev_pm_qos_{add|remove}_notifier()
[linux-2.6-block.git] / drivers / base / power / qos.c
index 6c91f8df1d59e0666c7eeb854f7b24e0f9e6b5d5..cfd46321251350928fd18c4301b10c54d6626110 100644 (file)
@@ -467,6 +467,7 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_remove_request);
  *
  * @dev: target device for the constraint
  * @notifier: notifier block managed by caller.
+ * @type: request type.
  *
  * Will register the notifier into a notification chain that gets called
  * upon changes to the target value for the device.
@@ -474,10 +475,14 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_remove_request);
  * If the device's constraints object doesn't exist when this routine is called,
  * it will be created (or error code will be returned if that fails).
  */
-int dev_pm_qos_add_notifier(struct device *dev, struct notifier_block *notifier)
+int dev_pm_qos_add_notifier(struct device *dev, struct notifier_block *notifier,
+                           enum dev_pm_qos_req_type type)
 {
        int ret = 0;
 
+       if (WARN_ON(type != DEV_PM_QOS_RESUME_LATENCY))
+               return -EINVAL;
+
        mutex_lock(&dev_pm_qos_mtx);
 
        if (IS_ERR(dev->power.qos))
@@ -500,15 +505,20 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_add_notifier);
  *
  * @dev: target device for the constraint
  * @notifier: notifier block to be removed.
+ * @type: request type.
  *
  * Will remove the notifier from the notification chain that gets called
  * upon changes to the target value.
  */
 int dev_pm_qos_remove_notifier(struct device *dev,
-                              struct notifier_block *notifier)
+                              struct notifier_block *notifier,
+                              enum dev_pm_qos_req_type type)
 {
        int retval = 0;
 
+       if (WARN_ON(type != DEV_PM_QOS_RESUME_LATENCY))
+               return -EINVAL;
+
        mutex_lock(&dev_pm_qos_mtx);
 
        /* Silently return if the constraints object is not present. */