summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-02-22 03:28:52 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-02-23 17:05:58 -0500
commitd08d1b27fe2a7f6923952613f5fab56ae47a6f5b (patch)
treecf82606bab0956cd4cf48ada2aa2cff2addbca4a /drivers/base
parente84b4a84e52d4cd8770b4242cd09df0133333f63 (diff)
PM / QoS: Remove global notifiers
They were never used in the kernel, so get rid of them. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/qos.c50
1 files changed, 4 insertions, 46 deletions
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index d888d9869b6a..271bec73185e 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -17,12 +17,9 @@
17 * 17 *
18 * This QoS design is best effort based. Dependents register their QoS needs. 18 * This QoS design is best effort based. Dependents register their QoS needs.
19 * Watchers register to keep track of the current QoS needs of the system. 19 * Watchers register to keep track of the current QoS needs of the system.
20 * Watchers can register different types of notification callbacks: 20 * Watchers can register a per-device notification callback using the
21 * . a per-device notification callback using the dev_pm_qos_*_notifier API. 21 * dev_pm_qos_*_notifier API. The notification chain data is stored in the
22 * The notification chain data is stored in the per-device constraint 22 * per-device constraint data struct.
23 * data struct.
24 * . a system-wide notification callback using the dev_pm_qos_*_global_notifier
25 * API. The notification chain data is stored in a static variable.
26 * 23 *
27 * Note about the per-device constraint data struct allocation: 24 * Note about the per-device constraint data struct allocation:
28 * . The per-device constraints data struct ptr is tored into the device 25 * . The per-device constraints data struct ptr is tored into the device
@@ -49,8 +46,6 @@
49static DEFINE_MUTEX(dev_pm_qos_mtx); 46static DEFINE_MUTEX(dev_pm_qos_mtx);
50static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx); 47static DEFINE_MUTEX(dev_pm_qos_sysfs_mtx);
51 48
52static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers);
53
54/** 49/**
55 * __dev_pm_qos_flags - Check PM QoS flags for a given device. 50 * __dev_pm_qos_flags - Check PM QoS flags for a given device.
56 * @dev: Device to check the PM QoS flags for. 51 * @dev: Device to check the PM QoS flags for.
@@ -135,8 +130,7 @@ s32 dev_pm_qos_read_value(struct device *dev)
135 * @value: Value to assign to the QoS request. 130 * @value: Value to assign to the QoS request.
136 * 131 *
137 * Internal function to update the constraints list using the PM QoS core 132 * Internal function to update the constraints list using the PM QoS core
138 * code and if needed call the per-device and the global notification 133 * code and if needed call the per-device callbacks.
139 * callbacks
140 */ 134 */
141static int apply_constraint(struct dev_pm_qos_request *req, 135static int apply_constraint(struct dev_pm_qos_request *req,
142 enum pm_qos_req_action action, s32 value) 136 enum pm_qos_req_action action, s32 value)
@@ -148,12 +142,6 @@ static int apply_constraint(struct dev_pm_qos_request *req,
148 case DEV_PM_QOS_RESUME_LATENCY: 142 case DEV_PM_QOS_RESUME_LATENCY:
149 ret = pm_qos_update_target(&qos->resume_latency, 143 ret = pm_qos_update_target(&qos->resume_latency,
150 &req->data.pnode, action, value); 144 &req->data.pnode, action, value);
151 if (ret) {
152 value = pm_qos_read_value(&qos->resume_latency);
153 blocking_notifier_call_chain(&dev_pm_notifiers,
154 (unsigned long)value,
155 req);
156 }
157 break; 145 break;
158 case DEV_PM_QOS_LATENCY_TOLERANCE: 146 case DEV_PM_QOS_LATENCY_TOLERANCE:
159 ret = pm_qos_update_target(&qos->latency_tolerance, 147 ret = pm_qos_update_target(&qos->latency_tolerance,
@@ -536,36 +524,6 @@ int dev_pm_qos_remove_notifier(struct device *dev,
536EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier); 524EXPORT_SYMBOL_GPL(dev_pm_qos_remove_notifier);
537 525
538/** 526/**
539 * dev_pm_qos_add_global_notifier - sets notification entry for changes to
540 * target value of the PM QoS constraints for any device
541 *
542 * @notifier: notifier block managed by caller.
543 *
544 * Will register the notifier into a notification chain that gets called
545 * upon changes to the target value for any device.
546 */
547int dev_pm_qos_add_global_notifier(struct notifier_block *notifier)
548{
549 return blocking_notifier_chain_register(&dev_pm_notifiers, notifier);
550}
551EXPORT_SYMBOL_GPL(dev_pm_qos_add_global_notifier);
552
553/**
554 * dev_pm_qos_remove_global_notifier - deletes notification for changes to
555 * target value of PM QoS constraints for any device
556 *
557 * @notifier: notifier block to be removed.
558 *
559 * Will remove the notifier from the notification chain that gets called
560 * upon changes to the target value for any device.
561 */
562int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier)
563{
564 return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
565}
566EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);
567
568/**
569 * dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor. 527 * dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
570 * @dev: Device whose ancestor to add the request for. 528 * @dev: Device whose ancestor to add the request for.
571 * @req: Pointer to the preallocated handle. 529 * @req: Pointer to the preallocated handle.