pm: rename PM_DEVICE_STATE_SUSPEND to PM_DEVICE_STATE_SUSPENDED
The verb tense for the suspended state was not consistent with other
states. The likely reason: state was being used as a command/action.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
diff --git a/doc/reference/power_management/index.rst b/doc/reference/power_management/index.rst
index af23b09..28a1802 100644
--- a/doc/reference/power_management/index.rst
+++ b/doc/reference/power_management/index.rst
@@ -248,7 +248,7 @@
Device context is preserved by the HW and need not be restored by the driver.
-:code:`PM_DEVICE_STATE_SUSPEND`
+:code:`PM_DEVICE_STATE_SUSPENDED`
Most device context is lost by the hardware. Device drivers must save and
restore or reinitialize any context lost by the hardware.
@@ -256,12 +256,12 @@
:code:`PM_DEVICE_STATE_SUSPENDING`
Device is currently transitioning from :c:macro:`PM_DEVICE_STATE_ACTIVE` to
- :c:macro:`PM_DEVICE_STATE_SUSPEND`.
+ :c:macro:`PM_DEVICE_STATE_SUSPENDED`.
:code:`PM_DEVICE_STATE_RESUMING`
- Device is currently transitioning from :c:macro:`PM_DEVICE_STATE_SUSPEND` to
- :c:macro:`PM_DEVICE_STATE_ACTIVE`.
+ Device is currently transitioning from :c:macro:`PM_DEVICE_STATE_SUSPENDED`
+ to :c:macro:`PM_DEVICE_STATE_ACTIVE`.
:code:`PM_DEVICE_STATE_OFF`
diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c
index 8105d98..29a3842 100644
--- a/drivers/ethernet/eth_mcux.c
+++ b/drivers/ethernet/eth_mcux.c
@@ -197,7 +197,7 @@
goto out;
}
- if (state == PM_DEVICE_STATE_SUSPEND) {
+ if (state == PM_DEVICE_STATE_SUSPENDED) {
LOG_DBG("Suspending");
ret = net_if_suspend(eth_ctx->iface);
diff --git a/drivers/flash/spi_flash_at45.c b/drivers/flash/spi_flash_at45.c
index 0339aee..ed4e2be 100644
--- a/drivers/flash/spi_flash_at45.c
+++ b/drivers/flash/spi_flash_at45.c
@@ -636,7 +636,7 @@
release(dev);
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
acquire(dev);
power_down_op(dev,
diff --git a/drivers/flash/spi_nor.c b/drivers/flash/spi_nor.c
index fa0b94b..4673de3 100644
--- a/drivers/flash/spi_nor.c
+++ b/drivers/flash/spi_nor.c
@@ -38,8 +38,8 @@
*
* When mapped to the Zephyr Device Power Management states:
* * PM_DEVICE_STATE_ACTIVE covers both active and standby modes;
- * * PM_DEVICE_STATE_SUSPEND, and PM_DEVICE_STATE_OFF all correspond
- * to deep-power-down mode.
+ * * PM_DEVICE_STATE_SUSPENDED, and PM_DEVICE_STATE_OFF all correspond to
+ * deep-power-down mode.
*/
#define SPI_NOR_MAX_ADDR_WIDTH 4
diff --git a/drivers/gpio/gpio_dw.c b/drivers/gpio/gpio_dw.c
index 70febf2..16b4e1b 100644
--- a/drivers/gpio/gpio_dw.c
+++ b/drivers/gpio/gpio_dw.c
@@ -446,7 +446,7 @@
{
int ret = 0;
- if (state == PM_DEVICE_STATE_SUSPEND) {
+ if (state == PM_DEVICE_STATE_SUSPENDED) {
ret = gpio_dw_suspend_port(port);
} else if (state == PM_DEVICE_STATE_ACTIVE) {
ret = gpio_dw_resume_from_suspend_port(port);
diff --git a/drivers/gpio/gpio_stm32.c b/drivers/gpio/gpio_stm32.c
index 59333a0..edb0e18 100644
--- a/drivers/gpio/gpio_stm32.c
+++ b/drivers/gpio/gpio_stm32.c
@@ -581,7 +581,7 @@
if (state == PM_DEVICE_STATE_ACTIVE) {
ret = gpio_stm32_clock_request(dev, true);
- } else if (state == PM_DEVICE_STATE_SUSPEND) {
+ } else if (state == PM_DEVICE_STATE_SUSPENDED) {
ret = gpio_stm32_clock_request(dev, false);
}
diff --git a/drivers/i2c/i2c_nrfx_twi.c b/drivers/i2c/i2c_nrfx_twi.c
index 5d777da..5d6a0f9 100644
--- a/drivers/i2c/i2c_nrfx_twi.c
+++ b/drivers/i2c/i2c_nrfx_twi.c
@@ -230,7 +230,7 @@
}
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
nrfx_twi_uninit(&get_dev_config(dev)->twi);
break;
diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c
index eda78f7..5ccd257 100644
--- a/drivers/i2c/i2c_nrfx_twim.c
+++ b/drivers/i2c/i2c_nrfx_twim.c
@@ -268,7 +268,7 @@
}
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
nrfx_twim_uninit(&get_dev_config(dev)->twim);
break;
diff --git a/drivers/interrupt_controller/intc_arcv2_irq_unit.c b/drivers/interrupt_controller/intc_arcv2_irq_unit.c
index d1407b4..7875f24 100644
--- a/drivers/interrupt_controller/intc_arcv2_irq_unit.c
+++ b/drivers/interrupt_controller/intc_arcv2_irq_unit.c
@@ -180,7 +180,7 @@
int ret = 0;
unsigned int key = arch_irq_lock();
- if (state == PM_DEVICE_STATE_SUSPEND) {
+ if (state == PM_DEVICE_STATE_SUSPENDED) {
ret = arc_v2_irq_unit_suspend(dev);
} else if (state == PM_DEVICE_STATE_ACTIVE) {
ret = arc_v2_irq_unit_resume(dev);
diff --git a/drivers/interrupt_controller/intc_ioapic.c b/drivers/interrupt_controller/intc_ioapic.c
index c9b5245..c244b3c 100644
--- a/drivers/interrupt_controller/intc_ioapic.c
+++ b/drivers/interrupt_controller/intc_ioapic.c
@@ -318,7 +318,7 @@
case PM_DEVICE_STATE_ACTIVE:
ret = ioapic_resume_from_suspend(dev);
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
ret = ioapic_suspend(dev);
break;
diff --git a/drivers/interrupt_controller/intc_loapic.c b/drivers/interrupt_controller/intc_loapic.c
index 2f77722..a8833cb 100644
--- a/drivers/interrupt_controller/intc_loapic.c
+++ b/drivers/interrupt_controller/intc_loapic.c
@@ -413,7 +413,7 @@
{
int ret = 0;
- if (state == PM_DEVICE_STATE_SUSPEND) {
+ if (state == PM_DEVICE_STATE_SUSPENDED) {
ret = loapic_suspend(port);
} else if (state == PM_DEVICE_STATE_ACTIVE) {
ret = loapic_resume(port);
diff --git a/drivers/modem/modem_receiver.c b/drivers/modem/modem_receiver.c
index c703157..63aaa6e 100644
--- a/drivers/modem/modem_receiver.c
+++ b/drivers/modem/modem_receiver.c
@@ -199,7 +199,7 @@
{
uart_irq_rx_disable(ctx->uart_dev);
#ifdef CONFIG_PM_DEVICE
- pm_device_state_set(ctx->uart_dev, PM_DEVICE_STATE_SUSPEND);
+ pm_device_state_set(ctx->uart_dev, PM_DEVICE_STATE_SUSPENDED);
#endif
return 0;
}
diff --git a/drivers/pwm/pwm_nrfx.c b/drivers/pwm/pwm_nrfx.c
index de4c624..c270e03 100644
--- a/drivers/pwm/pwm_nrfx.c
+++ b/drivers/pwm/pwm_nrfx.c
@@ -301,7 +301,7 @@
case PM_DEVICE_STATE_ACTIVE:
err = pwm_nrfx_init(dev);
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
pwm_nrfx_uninit(dev);
break;
diff --git a/drivers/sensor/bmp388/bmp388.c b/drivers/sensor/bmp388/bmp388.c
index df20d6d..b379c47 100644
--- a/drivers/sensor/bmp388/bmp388.c
+++ b/drivers/sensor/bmp388/bmp388.c
@@ -556,7 +556,7 @@
if (state == PM_DEVICE_STATE_ACTIVE) {
reg_val = BMP388_PWR_CTRL_MODE_NORMAL;
- } else if ((state == PM_DEVICE_STATE_SUSPEND) ||
+ } else if ((state == PM_DEVICE_STATE_SUSPENDED) ||
(state == PM_DEVICE_STATE_OFF)) {
reg_val = BMP388_PWR_CTRL_MODE_SLEEP;
} else {
diff --git a/drivers/sensor/fdc2x1x/fdc2x1x.c b/drivers/sensor/fdc2x1x/fdc2x1x.c
index 941acf8..dfc0b26 100644
--- a/drivers/sensor/fdc2x1x/fdc2x1x.c
+++ b/drivers/sensor/fdc2x1x/fdc2x1x.c
@@ -506,7 +506,7 @@
}
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
if (curr_state == PM_DEVICE_STATE_OFF) {
ret = fdc2x1x_set_shutdown(dev, false);
if (ret) {
diff --git a/drivers/sensor/sgp40/sgp40.c b/drivers/sensor/sgp40/sgp40.c
index 3a5af61..7e07fd7 100644
--- a/drivers/sensor/sgp40/sgp40.c
+++ b/drivers/sensor/sgp40/sgp40.c
@@ -195,7 +195,7 @@
if (power_state == PM_DEVICE_STATE_ACTIVE) {
/* activate the hotplate by sending a measure command */
cmd = SGP40_CMD_MEASURE_RAW;
- } else if (power_state == PM_DEVICE_STATE_SUSPEND) {
+ } else if (power_state == PM_DEVICE_STATE_SUSPENDED) {
cmd = SGP40_CMD_HEATER_OFF;
} else {
LOG_DBG("Power state not implemented.");
diff --git a/drivers/serial/uart_npcx.c b/drivers/serial/uart_npcx.c
index e534fb9..11c0916 100644
--- a/drivers/serial/uart_npcx.c
+++ b/drivers/serial/uart_npcx.c
@@ -442,7 +442,7 @@
enum pm_device_state next_state)
{
/* If next device power state is LOW or SUSPEND power state */
- if (next_state == PM_DEVICE_STATE_SUSPEND) {
+ if (next_state == PM_DEVICE_STATE_SUSPENDED) {
/*
* If uart device is busy with transmitting, the driver will
* stay in while loop and wait for the transaction is completed.
diff --git a/drivers/spi/spi_nrfx_spi.c b/drivers/spi/spi_nrfx_spi.c
index f043edb..7b02834 100644
--- a/drivers/spi/spi_nrfx_spi.c
+++ b/drivers/spi/spi_nrfx_spi.c
@@ -291,7 +291,7 @@
data->ctx.config = NULL;
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
nrfx_spi_uninit(&config->spi);
break;
diff --git a/drivers/spi/spi_nrfx_spim.c b/drivers/spi/spi_nrfx_spim.c
index 19691e8..e2cd11b 100644
--- a/drivers/spi/spi_nrfx_spim.c
+++ b/drivers/spi/spi_nrfx_spim.c
@@ -338,7 +338,7 @@
data->ctx.config = NULL;
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
case PM_DEVICE_STATE_OFF:
nrfx_spim_uninit(&config->spim);
break;
diff --git a/include/pm/device.h b/include/pm/device.h
index 555004f..5a019e5 100644
--- a/include/pm/device.h
+++ b/include/pm/device.h
@@ -41,7 +41,7 @@
* @note
* Device context may be lost.
*/
- PM_DEVICE_STATE_SUSPEND,
+ PM_DEVICE_STATE_SUSPENDED,
/**
* Device is suspended (forced).
*
diff --git a/samples/boards/nrf/system_off/src/main.c b/samples/boards/nrf/system_off/src/main.c
index eeef121..a73f946 100644
--- a/samples/boards/nrf/system_off/src/main.c
+++ b/samples/boards/nrf/system_off/src/main.c
@@ -66,7 +66,7 @@
k_busy_wait(BUSY_WAIT_S * USEC_PER_SEC);
printk("Busy-wait %u s with UART off\n", BUSY_WAIT_S);
- rc = pm_device_state_set(cons, PM_DEVICE_STATE_SUSPEND);
+ rc = pm_device_state_set(cons, PM_DEVICE_STATE_SUSPENDED);
k_busy_wait(BUSY_WAIT_S * USEC_PER_SEC);
rc = pm_device_state_set(cons, PM_DEVICE_STATE_ACTIVE);
@@ -74,7 +74,7 @@
k_sleep(K_SECONDS(SLEEP_S));
printk("Sleep %u s with UART off\n", SLEEP_S);
- rc = pm_device_state_set(cons, PM_DEVICE_STATE_SUSPEND);
+ rc = pm_device_state_set(cons, PM_DEVICE_STATE_SUSPENDED);
k_sleep(K_SECONDS(SLEEP_S));
rc = pm_device_state_set(cons, PM_DEVICE_STATE_ACTIVE);
diff --git a/samples/drivers/spi_flash_at45/src/main.c b/samples/drivers/spi_flash_at45/src/main.c
index 7f88f86..49c4df0 100644
--- a/samples/drivers/spi_flash_at45/src/main.c
+++ b/samples/drivers/spi_flash_at45/src/main.c
@@ -151,7 +151,7 @@
#if IS_ENABLED(CONFIG_PM_DEVICE)
printk("Putting the flash device into suspended state... ");
- err = pm_device_state_set(flash_dev, PM_DEVICE_STATE_SUSPEND);
+ err = pm_device_state_set(flash_dev, PM_DEVICE_STATE_SUSPENDED);
if (err != 0) {
printk("FAILED\n");
return;
diff --git a/samples/sensor/apds9960/src/main.c b/samples/sensor/apds9960/src/main.c
index d1b0557..f16f9a0 100644
--- a/samples/sensor/apds9960/src/main.c
+++ b/samples/sensor/apds9960/src/main.c
@@ -79,7 +79,7 @@
#ifdef CONFIG_PM_DEVICE
enum pm_device_state p_state;
- p_state = PM_DEVICE_STATE_SUSPEND;
+ p_state = PM_DEVICE_STATE_SUSPENDED;
pm_device_state_set(dev, p_state);
printk("set low power state for 2s\n");
k_sleep(K_MSEC(2000));
diff --git a/samples/sensor/fdc2x1x/src/main.c b/samples/sensor/fdc2x1x/src/main.c
index 7d7119b..04b40e9 100644
--- a/samples/sensor/fdc2x1x/src/main.c
+++ b/samples/sensor/fdc2x1x/src/main.c
@@ -43,7 +43,7 @@
case PM_DEVICE_STATE_ACTIVE:
printk("Enter ACTIVE_STATE ");
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
printk("Enter SUSPEND_STATE ");
break;
case PM_DEVICE_STATE_OFF:
@@ -95,7 +95,7 @@
enum pm_device_state p_state;
int ret;
- p_state = PM_DEVICE_STATE_SUSPEND;
+ p_state = PM_DEVICE_STATE_SUSPENDED;
ret = pm_device_state_set(dev, p_state);
pm_info(p_state, ret);
diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c
index 902e3b5..e56d89b 100644
--- a/subsys/net/ip/net_shell.c
+++ b/subsys/net/ip/net_shell.c
@@ -5532,7 +5532,7 @@
dev = net_if_get_device(iface);
- ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPEND);
+ ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPENDED);
if (ret != 0) {
PR_INFO("Iface could not be suspended: ");
diff --git a/subsys/pm/device.c b/subsys/pm/device.c
index 4592003..d19afbd 100644
--- a/subsys/pm/device.c
+++ b/subsys/pm/device.c
@@ -84,7 +84,7 @@
int pm_suspend_devices(void)
{
- return _pm_devices(PM_DEVICE_STATE_SUSPEND);
+ return _pm_devices(PM_DEVICE_STATE_SUSPENDED);
}
int pm_low_power_devices(void)
@@ -117,8 +117,8 @@
return "active";
case PM_DEVICE_STATE_LOW_POWER:
return "low power";
- case PM_DEVICE_STATE_SUSPEND:
- return "suspend";
+ case PM_DEVICE_STATE_SUSPENDED:
+ return "suspended";
case PM_DEVICE_STATE_FORCE_SUSPEND:
return "force suspend";
case PM_DEVICE_STATE_OFF:
@@ -138,8 +138,8 @@
}
switch (state) {
- case PM_DEVICE_STATE_SUSPEND:
- if ((dev->pm->state == PM_DEVICE_STATE_SUSPEND) ||
+ case PM_DEVICE_STATE_SUSPENDED:
+ if ((dev->pm->state == PM_DEVICE_STATE_SUSPENDED) ||
(dev->pm->state == PM_DEVICE_STATE_SUSPENDING)) {
return -EALREADY;
}
diff --git a/subsys/pm/device_runtime.c b/subsys/pm/device_runtime.c
index 9140cde..7239ef9 100644
--- a/subsys/pm/device_runtime.c
+++ b/subsys/pm/device_runtime.c
@@ -27,13 +27,13 @@
switch (dev->pm->state) {
case PM_DEVICE_STATE_ACTIVE:
if ((dev->pm->usage == 0) && dev->pm->enable) {
- ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPEND);
+ ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPENDED);
if (ret == 0) {
- dev->pm->state = PM_DEVICE_STATE_SUSPEND;
+ dev->pm->state = PM_DEVICE_STATE_SUSPENDED;
}
}
break;
- case PM_DEVICE_STATE_SUSPEND:
+ case PM_DEVICE_STATE_SUSPENDED:
if ((dev->pm->usage > 0) || !dev->pm->enable) {
ret = pm_device_state_set(dev, PM_DEVICE_STATE_ACTIVE);
if (ret == 0) {
@@ -77,7 +77,7 @@
SYS_PORT_TRACING_FUNC_ENTER(pm, device_request, dev, target_state);
__ASSERT((target_state == PM_DEVICE_STATE_ACTIVE) ||
- (target_state == PM_DEVICE_STATE_SUSPEND),
+ (target_state == PM_DEVICE_STATE_SUSPENDED),
"Invalid device PM state requested");
if (k_is_pre_kernel()) {
@@ -101,7 +101,7 @@
if (dev->pm->usage == 1) {
(void)pm_device_state_set(dev, PM_DEVICE_STATE_ACTIVE);
} else if (dev->pm->usage == 0) {
- (void)pm_device_state_set(dev, PM_DEVICE_STATE_SUSPEND);
+ (void)pm_device_state_set(dev, PM_DEVICE_STATE_SUSPENDED);
}
goto out;
}
@@ -164,12 +164,12 @@
int pm_device_put(const struct device *dev)
{
- return pm_device_request(dev, PM_DEVICE_STATE_SUSPEND, 0);
+ return pm_device_request(dev, PM_DEVICE_STATE_SUSPENDED, 0);
}
int pm_device_put_async(const struct device *dev)
{
- return pm_device_request(dev, PM_DEVICE_STATE_SUSPEND, PM_DEVICE_ASYNC);
+ return pm_device_request(dev, PM_DEVICE_STATE_SUSPENDED, PM_DEVICE_ASYNC);
}
void pm_device_enable(const struct device *dev)
@@ -179,7 +179,7 @@
dev->pm->dev = dev;
if (dev->pm_control != NULL) {
dev->pm->enable = true;
- dev->pm->state = PM_DEVICE_STATE_SUSPEND;
+ dev->pm->state = PM_DEVICE_STATE_SUSPENDED;
k_work_init_delayable(&dev->pm->work, pm_work_handler);
}
goto out;
@@ -199,7 +199,7 @@
*/
if (!dev->pm->dev) {
dev->pm->dev = dev;
- dev->pm->state = PM_DEVICE_STATE_SUSPEND;
+ dev->pm->state = PM_DEVICE_STATE_SUSPENDED;
k_work_init_delayable(&dev->pm->work, pm_work_handler);
} else {
k_work_schedule(&dev->pm->work, K_NO_WAIT);
diff --git a/tests/drivers/uart/uart_pm/src/main.c b/tests/drivers/uart/uart_pm/src/main.c
index 9a53c17..d9c0052 100644
--- a/tests/drivers/uart/uart_pm/src/main.c
+++ b/tests/drivers/uart/uart_pm/src/main.c
@@ -148,13 +148,13 @@
state_verify(dev, PM_DEVICE_STATE_ACTIVE);
communication_verify(dev, true);
- state_set(dev, PM_DEVICE_STATE_SUSPEND, 0);
+ state_set(dev, PM_DEVICE_STATE_SUSPENDED, 0);
communication_verify(dev, false);
state_set(dev, PM_DEVICE_STATE_ACTIVE, 0);
communication_verify(dev, true);
- state_set(dev, PM_DEVICE_STATE_SUSPEND, 0);
+ state_set(dev, PM_DEVICE_STATE_SUSPENDED, 0);
communication_verify(dev, false);
state_set(dev, PM_DEVICE_STATE_ACTIVE, 0);
@@ -171,7 +171,7 @@
communication_verify(dev, true);
uart_poll_out(dev, 'a');
- state_set(dev, PM_DEVICE_STATE_SUSPEND, 0);
+ state_set(dev, PM_DEVICE_STATE_SUSPENDED, 0);
communication_verify(dev, false);
@@ -181,7 +181,7 @@
/* Now same thing but with callback */
uart_poll_out(dev, 'a');
- state_set(dev, PM_DEVICE_STATE_SUSPEND, 0);
+ state_set(dev, PM_DEVICE_STATE_SUSPENDED, 0);
communication_verify(dev, false);
@@ -194,7 +194,7 @@
{
const struct device *uart = k_timer_user_data_get(timer);
- state_set(uart, PM_DEVICE_STATE_SUSPEND, 0);
+ state_set(uart, PM_DEVICE_STATE_SUSPENDED, 0);
}
static K_TIMER_DEFINE(pm_timer, timeout, NULL);
diff --git a/tests/kernel/device/src/main.c b/tests/kernel/device/src/main.c
index c4ea2c4..581bac4 100644
--- a/tests/kernel/device/src/main.c
+++ b/tests/kernel/device/src/main.c
@@ -287,7 +287,7 @@
{
const struct device *dev;
int busy, ret;
- enum pm_device_state device_power_state = PM_DEVICE_STATE_SUSPEND;
+ enum pm_device_state device_power_state = PM_DEVICE_STATE_SUSPENDED;
dev = device_get_binding(DUMMY_PORT_2);
zassert_false((dev == NULL), NULL);
diff --git a/tests/net/pm/src/main.c b/tests/net/pm/src/main.c
index 42e1a29..25e5a83 100644
--- a/tests/net/pm/src/main.c
+++ b/tests/net/pm/src/main.c
@@ -27,7 +27,7 @@
struct fake_dev_context *ctx = dev->data;
int ret = 0;
- if (state == PM_DEVICE_STATE_SUSPEND) {
+ if (state == PM_DEVICE_STATE_SUSPENDED) {
ret = net_if_suspend(ctx->iface);
if (ret == -EBUSY) {
goto out;
@@ -142,13 +142,13 @@
*/
k_yield();
- ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPEND);
+ ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPENDED);
zassert_true(ret == 0, "Could not set state");
zassert_true(net_if_is_suspended(iface), "net iface is not suspended");
/* Let's try to suspend it again, it should fail relevantly */
- ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPEND);
+ ret = pm_device_state_set(dev, PM_DEVICE_STATE_SUSPENDED);
zassert_true(ret == -EALREADY, "Could change state");
zassert_true(net_if_is_suspended(iface), "net iface is not suspended");
diff --git a/tests/subsys/pm/device_runtime/src/main.c b/tests/subsys/pm/device_runtime/src/main.c
index 29e6638..ba32406 100644
--- a/tests/subsys/pm/device_runtime/src/main.c
+++ b/tests/subsys/pm/device_runtime/src/main.c
@@ -48,7 +48,7 @@
/* At this point threadB should have put the device and
* the current state should be SUSPENDED.
*/
- zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPEND, "Wrong state");
+ zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPENDED, "Wrong state");
k_sem_take(&sem, K_FOREVER);
@@ -81,7 +81,7 @@
zassert_true(ret == 0, "Fail to wait transaction");
/* Check the state */
- zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPEND, "Wrong state");
+ zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPENDED, "Wrong state");
}
/*
@@ -135,7 +135,7 @@
ret = api->close_sync(dev);
zassert_true(ret == 0, "Fail to suspend device");
- zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPEND, "Wrong state");
+ zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPENDED, "Wrong state");
}
/*
@@ -161,7 +161,7 @@
ret = api->close_sync(dev);
zassert_true(ret == 0, "Fail to suspend device");
- zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPEND, "Wrong state");
+ zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPENDED, "Wrong state");
}
/*
@@ -186,7 +186,7 @@
ret = api->close_sync(dev);
zassert_true(ret == 0, "Fail to suspend device");
- zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPEND, "Wrong state");
+ zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPENDED, "Wrong state");
}
/* Now do all requests for get and then all for put*/
@@ -204,7 +204,7 @@
zassert_true(ret == 0, "Fail to wait transaction");
/* Check the state */
- zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPEND, "Wrong state");
+ zassert_true(dev->pm->state == PM_DEVICE_STATE_SUSPENDED, "Wrong state");
/* Finally off by one to keep the device active*/
for (i = 0; i < MAX_TIMES; i++) {
diff --git a/tests/subsys/pm/power_mgmt/src/main.c b/tests/subsys/pm/power_mgmt/src/main.c
index d27610b..1b17bb4 100644
--- a/tests/subsys/pm/power_mgmt/src/main.c
+++ b/tests/subsys/pm/power_mgmt/src/main.c
@@ -181,7 +181,7 @@
api->close(dev);
pm_device_state_get(dev, &device_power_state);
- zassert_equal(device_power_state, PM_DEVICE_STATE_SUSPEND, NULL);
+ zassert_equal(device_power_state, PM_DEVICE_STATE_SUSPENDED, NULL);
/* reopen device as it will be closed in teardown */
api->open(dev);
}