power: fix condition for available starting state 88/285388/4
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 12 Dec 2022 02:17:00 +0000 (11:17 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 12 Dec 2022 04:37:18 +0000 (13:37 +0900)
commitd861ffd68509eb9871c0ab0f990e8cde61da5940
tree3b1bf180786a76e73907bb7260c849c903708433
parent888dc040d3e1b48d7d370919292ccf2a0646562c
power: fix condition for available starting state

 The condition for checking queue should have come first. This matters
during a system haven't been initialized, that is before the call of
delayed_init_callback(). Before the delayed_init_callback(), all
requests are enqueued even though transition is not underway. In this
case, it is possible to meet the both condtitions below:
  1. there is no ongoing transition
  2. there are some enqueued transitions
In this situation, we must select the last state of transition as an
available state. But the previous condition chooses the current state.

Change-Id: If6285e2ca78734378ac9b626947b24ebb3d8594d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/power/power.c