参照元†
- FIXME: これは何?
- CONFIG_PM_RUNTIME 有効: drivers/base/power/runtime.c の実装を使用する。
- CONFIG_PM_RUNTIME 無効: include/linux/pm_runtime.h の実装を使用する。
- struct device *dev
- bool sync
返り値†
実装 drivers/base/power/runtime.c†
/**
* __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);
retval = sync ? pm_runtime_resume(dev) : pm_request_resume(dev);
return retval;
}
EXPORT_SYMBOL_GPL(__pm_runtime_get);
実装 include/linux/pm_runtime.h†
#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; }
(...snip...)
#endif /* !CONFIG_PM_RUNTIME */
コメント†