diff options
| author | Sakari Ailus <[email protected]> | 2024-01-30 11:28:05 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2024-02-12 15:57:47 +0000 |
| commit | c0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3 (patch) | |
| tree | 2e458071fa27a8d095d1c872bb0c74c15763cfe3 /drivers/pci/pci.c | |
| parent | Linux 6.8-rc4 (diff) | |
| download | kernel-c0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3.tar.gz kernel-c0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3.zip | |
PM: runtime: Simplify pm_runtime_get_if_active() usage
There are two ways to opportunistically increment a device's runtime PM
usage count, calling either pm_runtime_get_if_active() or
pm_runtime_get_if_in_use(). The former has an argument to tell whether to
ignore the usage count or not, and the latter simply calls the former with
ign_usage_count set to false. The other users that want to ignore the
usage_count will have to explicitly set that argument to true which is a
bit cumbersome.
To make this function more practical to use, remove the ign_usage_count
argument from the function. The main implementation is in a static
function called pm_runtime_get_conditional() and implementations of
pm_runtime_get_if_active() and pm_runtime_get_if_in_use() are moved to
runtime.c.
Signed-off-by: Sakari Ailus <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Acked-by: Takashi Iwai <[email protected]> # sound/
Reviewed-by: Jacek Lawrynowicz <[email protected]> # drivers/accel/ivpu/
Acked-by: Rodrigo Vivi <[email protected]> # drivers/gpu/drm/i915/
Reviewed-by: Rodrigo Vivi <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]> # drivers/pci/
Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'drivers/pci/pci.c')
| -rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9ab9b1008d8b..cb51c4079013 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2536,7 +2536,7 @@ static void pci_pme_list_scan(struct work_struct *work) * If the device is in a low power state it * should not be polled either. */ - pm_status = pm_runtime_get_if_active(dev, true); + pm_status = pm_runtime_get_if_active(dev); if (!pm_status) continue; |
