aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/runtime.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 15:03:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 15:03:03 -0500
commit529e89430d6c0d64db8ac474cb95e68e2527c79a (patch)
tree0407825d29351d04474b3a1294f2b4d42a1e8e03 /drivers/base/power/runtime.c
parent61ecdb84c1f05ad445db4584ae375a15c0e8ae47 (diff)
parentd8bed5a4f343d1826153ecf8e7932126c757a21d (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM: rwsem.h need not be included into main.c PM: Remove unnecessary goto from device_resume_noirq() PM: Add initcall_debug style timing for suspend/resume PM: allow for usage_count > 0 in pm_runtime_get()
Diffstat (limited to 'drivers/base/power/runtime.c')
-rw-r--r--drivers/base/power/runtime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 5a01ecef4af3..40d7720a4b21 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -701,15 +701,15 @@ EXPORT_SYMBOL_GPL(pm_request_resume);
701 * @dev: Device to handle. 701 * @dev: Device to handle.
702 * @sync: If set and the device is suspended, resume it synchronously. 702 * @sync: If set and the device is suspended, resume it synchronously.
703 * 703 *
704 * Increment the usage count of the device and if it was zero previously, 704 * Increment the usage count of the device and resume it or submit a resume
705 * resume it or submit a resume request for it, depending on the value of @sync. 705 * request for it, depending on the value of @sync.
706 */ 706 */
707int __pm_runtime_get(struct device *dev, bool sync) 707int __pm_runtime_get(struct device *dev, bool sync)
708{ 708{
709 int retval = 1; 709 int retval;
710 710
711 if (atomic_add_return(1, &dev->power.usage_count) == 1) 711 atomic_inc(&dev->power.usage_count);
712 retval = sync ? pm_runtime_resume(dev) : pm_request_resume(dev); 712 retval = sync ? pm_runtime_resume(dev) : pm_request_resume(dev);
713 713
714 return retval; 714 return retval;
715} 715}