PM: runtime: Take active children into account in pm_runtime_get_if_in_use()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Jul 2025 10:41:45 +0000 (12:41 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 15 Jul 2025 13:03:25 +0000 (15:03 +0200)
commit51888393cc64dd0462d0b96c13ab94873abbc030
tree913c47c3fc478d7148ae674c844a4a42ea1e5a59
parentcd4da713f99651e99fbce8ed6b6ec8f686c029a8
PM: runtime: Take active children into account in pm_runtime_get_if_in_use()

For all practical purposes, there is no difference between the situation
in which a given device is not ignoring children and its active child
count is nonzero and the situation in which its runtime PM usage counter
is nonzero.  However, pm_runtime_get_if_in_use() will only increment the
device's usage counter and return 1 in the latter case.

For consistency, make it do so in the former case either by adjusting
pm_runtime_get_conditional() and update the related kerneldoc comments
accordingly.

Fixes: c111566bea7c ("PM: runtime: Add pm_runtime_get_if_active()")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: 5.10+ <stable@vger.kernel.org> # 5.10+: c0ef3df8dbae: PM: runtime: Simplify pm_runtime_get_if_active() usage
Cc: 5.10+ <stable@vger.kernel.org> # 5.10+
Link: https://patch.msgid.link/12700973.O9o76ZdvQC@rjwysocki.net
drivers/base/power/runtime.c