Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305824
b: refs/heads/master
c: 23e0fc5
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed May 1, 2012
1 parent c686062 commit 307072c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76e267d822f2913893ad210ba431607aa8e2af94
refs/heads/master: 23e0fc5ae64925e0ff1b6221b83dff1b217545df
19 changes: 12 additions & 7 deletions trunk/drivers/base/power/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,21 +352,26 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_remove_request);
*
* Will register the notifier into a notification chain that gets called
* upon changes to the target value for the device.
*
* 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 retval = 0;
int ret = 0;

mutex_lock(&dev_pm_qos_mtx);

/* Silently return if the constraints object is not present. */
if (dev->power.constraints)
retval = blocking_notifier_chain_register(
dev->power.constraints->notifiers,
notifier);
if (!dev->power.constraints)
ret = dev->power.power_state.event != PM_EVENT_INVALID ?
dev_pm_qos_constraints_allocate(dev) : -ENODEV;

if (!ret)
ret = blocking_notifier_chain_register(
dev->power.constraints->notifiers, notifier);

mutex_unlock(&dev_pm_qos_mtx);
return retval;
return ret;
}
EXPORT_SYMBOL_GPL(dev_pm_qos_add_notifier);

Expand Down

0 comments on commit 307072c

Please sign in to comment.