PM: sleep: Move some assignments from under a lock
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 29 Jan 2024 16:27:33 +0000 (17:27 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 5 Feb 2024 13:28:54 +0000 (14:28 +0100)
commita4b64b893428734fc872a162ca7d92aa1ca1c429
tree71c95c5c8f17e100f5c2cc7f6ef45eff04a6d8a9
parentac6f87aaa26fa88680db23051a5d2b13a08d13b8
PM: sleep: Move some assignments from under a lock

The async_error and pm_transition variables are set under dpm_list_mtx
in multiple places in the system-wide device PM core code, which is
unnecessary and confusing, so rearrange the code so that the variables
in question are set before acquiring the lock.

While at it, add some empty code lines around locking to improve the
consistency of the code.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/base/power/main.c