*参照元 [#ia1b5961]
#backlinks
*説明 [#ife20bc1]
-パス: [[linux-2.6.33/drivers/base/power/runtime.c]]
-パス: [[linux-2.6.33/include/linux/pm_runtime.h]]
-FIXME: これは何?
--CONFIG_PM_RUNTIME 有効: drivers/base/power/runtime.c の実装を使用する。
---
--CONFIG_PM_RUNTIME 無効: include/linux/pm_runtime.h の実装を使用する。
---何もしない。常に 1 を返す。
**引数 [#zd4b7dcf]
-struct device *dev
--
--[[linux-2.6.33/device]]
-bool sync
--
**返り値 [#oa7e6ebd]
-int
--
**参考 [#n78dd090]
*実装 drivers/base/power/runtime.c [#h34308ed]
/**
* __pm_runtime_get - Reference count a device and wake it up, if necessary.
* @dev: Device to handle.
* @sync: If set and the device is suspended, resume it synchronously.
*
* Increment the usage count of the device and resume it or submit a resume
* request for it, depending on the value of @sync.
*/
int __pm_runtime_get(struct device *dev, bool sync)
{
int retval;
atomic_inc(&dev->power.usage_count);
-
--[[linux-2.6.33/atomic_inc()]]
retval = sync ? pm_runtime_resume(dev) : pm_request_resume(dev);
-
--[[linux-2.6.33/pm_runtime_resume()]]
-
--[[linux-2.6.33/pm_request_resume()]]
return retval;
}
EXPORT_SYMBOL_GPL(__pm_runtime_get);
-GPL のモジュールにのみシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL_GPL()]]
*実装 include/linux/pm_runtime.h [#ga5547b9]
#ifdef CONFIG_PM_RUNTIME
(...snip...)
extern int __pm_runtime_get(struct device *dev, bool sync);
(...snip...)
#else /* !CONFIG_PM_RUNTIME */
(...snip...)
static inline int __pm_runtime_get(struct device *dev, bool sync) { return 1; }
-何もしない、常に 1 を返す。
(...snip...)
#endif /* !CONFIG_PM_RUNTIME */
*コメント [#x7893e85]