pm: use actions for device PM control
Instead of passing target states, use actions for device PM control.
Actions represent better the meaning of the callback argument.
Furthermore, they are more future proof as they can be suitable for
other PM actions that have no direct mapping to a state. If we compare
with Linux, we could have a multi-stage suspend/resume. Such scenario
would not have a good mapping when using target states.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
diff --git a/drivers/interrupt_controller/intc_loapic.c b/drivers/interrupt_controller/intc_loapic.c
index ffaa410..0a8f055 100644
--- a/drivers/interrupt_controller/intc_loapic.c
+++ b/drivers/interrupt_controller/intc_loapic.c
@@ -409,15 +409,15 @@
*/
__pinned_func
static int loapic_device_ctrl(const struct device *dev,
- enum pm_device_state state)
+ enum pm_device_action action)
{
int ret = 0;
- switch (state) {
- case PM_DEVICE_STATE_SUSPENDED:
+ switch (action) {
+ case PM_DEVICE_ACTION_SUSPEND:
ret = loapic_suspend(dev);
break;
- case PM_DEVICE_STATE_ACTIVE:
+ case PM_DEVICE_ACTION_RESUME:
ret = loapic_resume(dev);
break;
default: