pm: device_runtime: Change API behavior s/_sync/_async
Most APIs have the default synchronous and an asynchronous version with the sufix _async because that is the most common use. All devices in tree right now are using the synchronous version, so just change it to be consistent with the rest of the system. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
452890628a
commit
d67a5786bc
10 changed files with 37 additions and 39 deletions
|
@ -68,7 +68,7 @@ void pm_device_disable(const struct device *dev);
|
|||
* pm signal mechanism to know the completion of resume operation.
|
||||
* @retval Errno Negative errno code if failure.
|
||||
*/
|
||||
int pm_device_get(const struct device *dev);
|
||||
int pm_device_get_async(const struct device *dev);
|
||||
|
||||
/**
|
||||
* @brief Call device resume synchronously based on usage count
|
||||
|
@ -83,7 +83,7 @@ int pm_device_get(const struct device *dev);
|
|||
* @retval 0 If successful.
|
||||
* @retval Errno Negative errno code if failure.
|
||||
*/
|
||||
int pm_device_get_sync(const struct device *dev);
|
||||
int pm_device_get(const struct device *dev);
|
||||
|
||||
/**
|
||||
* @brief Call device suspend asynchronously based on usage count
|
||||
|
@ -101,7 +101,7 @@ int pm_device_get_sync(const struct device *dev);
|
|||
* signal mechanism to know the completion of suspend operation.
|
||||
* @retval Errno Negative errno code if failure.
|
||||
*/
|
||||
int pm_device_put(const struct device *dev);
|
||||
int pm_device_put_async(const struct device *dev);
|
||||
|
||||
/**
|
||||
* @brief Call device suspend synchronously based on usage count
|
||||
|
@ -116,14 +116,14 @@ int pm_device_put(const struct device *dev);
|
|||
* @retval 0 If successful.
|
||||
* @retval Errno Negative errno code if failure.
|
||||
*/
|
||||
int pm_device_put_sync(const struct device *dev);
|
||||
int pm_device_put(const struct device *dev);
|
||||
|
||||
/**
|
||||
* @brief Wait on a device to finish an operation.
|
||||
*
|
||||
* The calling thread blocks until the device finishes a @ref pm_device_put or
|
||||
* @ref pm_device_get operation. If there is no operation in progress
|
||||
* this function will return immediately.
|
||||
* The calling thread blocks until the device finishes a
|
||||
* @ref pm_device_put_async or @ref pm_device_get_async operation. If there is
|
||||
* no operation in progress this function will return immediately.
|
||||
*
|
||||
* @param dev Pointer to device structure of the specific device driver
|
||||
* the caller is interested in.
|
||||
|
@ -138,9 +138,9 @@ int pm_device_wait(const struct device *dev, k_timeout_t timeout);
|
|||
static inline void pm_device_enable(const struct device *dev) { }
|
||||
static inline void pm_device_disable(const struct device *dev) { }
|
||||
static inline int pm_device_get(const struct device *dev) { return -ENOSYS; }
|
||||
static inline int pm_device_get_sync(const struct device *dev) { return -ENOSYS; }
|
||||
static inline int pm_device_get_async(const struct device *dev) { return -ENOSYS; }
|
||||
static inline int pm_device_put(const struct device *dev) { return -ENOSYS; }
|
||||
static inline int pm_device_put_sync(const struct device *dev) { return -ENOSYS; }
|
||||
static inline int pm_device_put_async(const struct device *dev) { return -ENOSYS; }
|
||||
static inline int pm_device_wait(const struct device *dev,
|
||||
k_timeout_t timeout) { return -ENOSYS; }
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue