pm: device: rename device_pm struct to pm_device

Prefix all PM related functions/structures with pm.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-05-03 17:42:31 +02:00 committed by Anas Nashif
commit d31a9be27c
4 changed files with 6 additions and 6 deletions

View file

@ -358,7 +358,7 @@ struct device_state {
#ifdef CONFIG_PM_DEVICE #ifdef CONFIG_PM_DEVICE
/* Power management data */ /* Power management data */
struct device_pm pm; struct pm_device pm;
#endif /* CONFIG_PM_DEVICE */ #endif /* CONFIG_PM_DEVICE */
}; };
@ -389,7 +389,7 @@ struct device {
int (*device_pm_control)(const struct device *dev, uint32_t command, int (*device_pm_control)(const struct device *dev, uint32_t command,
void *context, device_pm_cb cb, void *arg); void *context, device_pm_cb cb, void *arg);
/** Pointer to device instance power management data */ /** Pointer to device instance power management data */
struct device_pm * const pm; struct pm_device * const pm;
#endif #endif
}; };

View file

@ -83,7 +83,7 @@ typedef void (*device_pm_cb)(const struct device *dev,
/** /**
* @brief Device PM info * @brief Device PM info
*/ */
struct device_pm { struct pm_device {
/** Pointer to the device */ /** Pointer to the device */
const struct device *dev; const struct device *dev;
/** Lock to synchronize the get/put operations */ /** Lock to synchronize the get/put operations */

View file

@ -28,7 +28,7 @@ extern uint32_t __device_init_status_start[];
static inline void device_pm_state_init(const struct device *dev) static inline void device_pm_state_init(const struct device *dev)
{ {
#ifdef CONFIG_PM_DEVICE #ifdef CONFIG_PM_DEVICE
*dev->pm = (struct device_pm){ *dev->pm = (struct pm_device){
.usage = ATOMIC_INIT(0), .usage = ATOMIC_INIT(0),
.lock = Z_SEM_INITIALIZER(dev->pm->lock, 1, 1), .lock = Z_SEM_INITIALIZER(dev->pm->lock, 1, 1),
.signal = K_POLL_SIGNAL_INITIALIZER(dev->pm->signal), .signal = K_POLL_SIGNAL_INITIALIZER(dev->pm->signal),

View file

@ -45,8 +45,8 @@ static void device_pm_callback(const struct device *dev,
static void pm_work_handler(struct k_work *work) static void pm_work_handler(struct k_work *work)
{ {
struct device_pm *pm = CONTAINER_OF(work, struct pm_device *pm = CONTAINER_OF(work,
struct device_pm, work); struct pm_device, work);
const struct device *dev = pm->dev; const struct device *dev = pm->dev;
int ret = 0; int ret = 0;
uint8_t pm_state; uint8_t pm_state;