summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom/camss/camss-csiphy.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-04-23 18:19:18 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-05-19 10:51:42 +0300
commit09dfb36ce250e76322ac8940c10d75e53a9e48d4 (patch)
tree2dcfa851681e8d995d87dca8c9c8e17d20fcc0a0 /drivers/media/platform/qcom/camss/camss-csiphy.c
parent97df01fae800ff765dbb247ee30c7a438b2ae07b (diff)
downloadlinux-09dfb36ce250e76322ac8940c10d75e53a9e48d4.tar.xz
media: camss: use pm_runtime_resume_and_get()
Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") added pm_runtime_resume_and_get() in order to automatically handle dev->power.usage_count decrement on errors. Use the new API, in order to cleanup the error check logic. Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/camss/camss-csiphy.c')
-rw-r--r--drivers/media/platform/qcom/camss/camss-csiphy.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c
index 1996541278a2..b623e007aec6 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy.c
@@ -197,11 +197,9 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on)
if (on) {
int ret;
- ret = pm_runtime_get_sync(dev);
- if (ret < 0) {
- pm_runtime_put_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
return ret;
- }
ret = csiphy_set_clock_rates(csiphy);
if (ret < 0) {