Skip to content

Commit 86abf46

Browse files
Flavio Ceolincfriedt
authored andcommitted
tests: pm: power_mgmt: Change global variable name
Using a more descriptive name for a global variable since "dev" is widely used in several APIs signature. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 285ab0e commit 86abf46

File tree

1 file changed

+10
-10
lines changed
  • tests/subsys/pm/power_mgmt/src

1 file changed

+10
-10
lines changed

tests/subsys/pm/power_mgmt/src/main.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static bool leave_idle;
2727
static bool idle_entered;
2828
static bool testing_device_runtime;
2929

30-
static const struct device *dev;
30+
static const struct device *device_dummy;
3131
static struct dummy_driver_api *api;
3232

3333
void pm_power_state_set(struct pm_state_info info)
@@ -40,7 +40,7 @@ void pm_power_state_set(struct pm_state_info info)
4040

4141
/* this function is called after devices enter low power state */
4242
enum pm_device_state device_power_state;
43-
pm_device_state_get(dev, &device_power_state);
43+
pm_device_state_get(device_dummy, &device_power_state);
4444

4545
if (testing_device_runtime) {
4646
/* If device runtime is enable, the device should still be
@@ -103,7 +103,7 @@ static void notify_pm_state_entry(enum pm_state state)
103103
zassert_true(z_is_idle_thread_object(_current), NULL);
104104
zassert_equal(state, PM_STATE_SUSPEND_TO_IDLE, NULL);
105105

106-
pm_device_state_get(dev, &device_power_state);
106+
pm_device_state_get(device_dummy, &device_power_state);
107107
if (testing_device_runtime) {
108108
/* If device runtime is enable, the device should still be
109109
* active
@@ -129,7 +129,7 @@ static void notify_pm_state_exit(enum pm_state state)
129129
zassert_equal(state, PM_STATE_SUSPEND_TO_IDLE, NULL);
130130

131131
/* at this point, devices are active again*/
132-
pm_device_state_get(dev, &device_power_state);
132+
pm_device_state_get(device_dummy, &device_power_state);
133133
zassert_equal(device_power_state, PM_DEVICE_STATE_ACTIVE, NULL);
134134
leave_idle = true;
135135

@@ -207,10 +207,10 @@ void test_power_state_notification(void)
207207

208208
enter_low_power = true;
209209

210-
ret = api->open(dev);
210+
ret = api->open(device_dummy);
211211
zassert_true(ret == 0, "Fail to open device");
212212

213-
pm_device_state_get(dev, &device_power_state);
213+
pm_device_state_get(device_dummy, &device_power_state);
214214
zassert_equal(device_power_state, PM_DEVICE_STATE_ACTIVE, NULL);
215215

216216

@@ -220,8 +220,8 @@ void test_power_state_notification(void)
220220
k_sleep(SLEEP_TIMEOUT);
221221
zassert_true(leave_idle, NULL);
222222

223-
api->close(dev);
224-
pm_device_state_get(dev, &device_power_state);
223+
api->close(device_dummy);
224+
pm_device_state_get(device_dummy, &device_power_state);
225225
zassert_equal(device_power_state, PM_DEVICE_STATE_SUSPENDED, NULL);
226226
}
227227

@@ -233,8 +233,8 @@ void test_main(void)
233233
};
234234

235235
pm_notifier_register(&notifier);
236-
dev = device_get_binding(DUMMY_DRIVER_NAME);
237-
api = (struct dummy_driver_api *)dev->api;
236+
device_dummy = device_get_binding(DUMMY_DRIVER_NAME);
237+
api = (struct dummy_driver_api *)device_dummy->api;
238238

239239
ztest_test_suite(power_management_test,
240240
ztest_1cpu_unit_test(test_power_idle),

0 commit comments

Comments
 (0)