Skip to content

Commit a1fd8cd

Browse files
lyakhcarlescufi
authored andcommitted
runtime-pm: remove a superfluous k_is_pre_kernel() test
If runtime_suspend() is called early during Zephyr initialisation, while k_is_pre_kernel() returns 'true,' 'async' is set to 'false,' so if 'async' is 'true,' Zephyr initialisation is definitely complete, so there is no need to check k_is_pre_kernel() again. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent ac71dfa commit a1fd8cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/pm/device_runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static int runtime_suspend(const struct device *dev, bool async,
7676
goto unlock;
7777
}
7878

79-
if (async && !k_is_pre_kernel()) {
79+
if (async) {
8080
/* queue suspend */
8181
pm->state = PM_DEVICE_STATE_SUSPENDING;
8282
(void)k_work_schedule(&pm->work, delay);

0 commit comments

Comments
 (0)