]> git.baikalelectronics.ru Git - kernel.git/commit
PM: runtime: Simplify locking in pm_runtime_put_suppliers()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 17 Dec 2021 19:16:02 +0000 (20:16 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 22 Dec 2021 17:37:55 +0000 (18:37 +0100)
commit04ba455d1c8bd927c585859e2b6526660c557052
tree8e12bb6a33e5a4ebb454a24832756f64cf6fd065
parent316862ba99fa3de83e4df415739f01a2b3d5d2e4
PM: runtime: Simplify locking in pm_runtime_put_suppliers()

Notice that pm_runtime_put_suppliers() cannot be called with
disabled interrupts, because it may sleep (due to the device
links read locking in the non-SRCU case), and so it can use
spin_lock_irq() and spin_unlock_irq() for the locking.

Update the function accordingly and while at it move the "put"
local variable in it into the inner block where it is used.

This change is not expected to have any visible functional impact.

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