diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-25 23:43:05 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-25 23:43:05 +0100 |
commit | 0015afaa1f818d38ea9f8e81a84a6aeeca5fdaf0 (patch) | |
tree | 8f8279cf0117d210230ef9fcacb05f960bf6f8f5 /drivers/base/power/qos.c | |
parent | b7ba68c4a072c9aa8f04b8cf7838b6cd2f48d918 (diff) | |
parent | 00dc9ad18d707f36b2fb4af98fd2cf0548d2b258 (diff) |
Merge branch 'pm-runtime' into pm-for-linus
* pm-runtime:
PM / Runtime: Use device PM QoS constraints (v2)
Diffstat (limited to 'drivers/base/power/qos.c')
-rw-r--r-- | drivers/base/power/qos.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c index 86de6c50fc4..03f4bd069ca 100644 --- a/drivers/base/power/qos.c +++ b/drivers/base/power/qos.c @@ -47,21 +47,29 @@ static DEFINE_MUTEX(dev_pm_qos_mtx); static BLOCKING_NOTIFIER_HEAD(dev_pm_notifiers); /** - * dev_pm_qos_read_value - Get PM QoS constraint for a given device. + * __dev_pm_qos_read_value - Get PM QoS constraint for a given device. + * @dev: Device to get the PM QoS constraint value for. + * + * This routine must be called with dev->power.lock held. + */ +s32 __dev_pm_qos_read_value(struct device *dev) +{ + struct pm_qos_constraints *c = dev->power.constraints; + + return c ? pm_qos_read_value(c) : 0; +} + +/** + * dev_pm_qos_read_value - Get PM QoS constraint for a given device (locked). * @dev: Device to get the PM QoS constraint value for. */ s32 dev_pm_qos_read_value(struct device *dev) { - struct pm_qos_constraints *c; unsigned long flags; - s32 ret = 0; + s32 ret; spin_lock_irqsave(&dev->power.lock, flags); - - c = dev->power.constraints; - if (c) - ret = pm_qos_read_value(c); - + ret = __dev_pm_qos_read_value(dev); spin_unlock_irqrestore(&dev->power.lock, flags); return ret; |