aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/ccs/ccs-core.c
diff options
context:
space:
mode:
authorSakari Ailus <[email protected]>2024-01-30 11:28:05 +0000
committerRafael J. Wysocki <[email protected]>2024-02-12 15:57:47 +0000
commitc0ef3df8dbaef51ee4cfd58a471adf2eaee6f6b3 (patch)
tree2e458071fa27a8d095d1c872bb0c74c15763cfe3 /drivers/media/i2c/ccs/ccs-core.c
parentLinux 6.8-rc4 (diff)
downloadkernel-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/media/i2c/ccs/ccs-core.c')
-rw-r--r--drivers/media/i2c/ccs/ccs-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index e21287d50c15..e1ae0f9fad43 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -674,7 +674,7 @@ static int ccs_set_ctrl(struct v4l2_ctrl *ctrl)
break;
}
- pm_status = pm_runtime_get_if_active(&client->dev, true);
+ pm_status = pm_runtime_get_if_active(&client->dev);
if (!pm_status)
return 0;