summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/ov13858.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-07-30 07:44:43 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-31 09:23:53 -0400
commit4d471563d87b2b83e73b8abffb9273950e6d2e36 (patch)
tree8cf25587205d91ea7f3a947fbea88c95f9a4e299 /drivers/media/i2c/ov13858.c
parentd508fffb92d9b8b9e0951657b2b78cf752ff0b4e (diff)
downloadlinux-4d471563d87b2b83e73b8abffb9273950e6d2e36.tar.bz2
media: i2c: Fix pm_runtime_get_if_in_use() usage in sensor drivers
pm_runtime_get_if_in_use() returns -EINVAL if runtime PM is disabled. This should not be considered an error. Generally the driver has enabled runtime PM already so getting this error due to runtime PM being disabled will not happen. Instead of checking for lesser or equal to zero, check for zero only. Address this for drivers where this pattern exists. This patch has been produced using the following command: $ git grep -l pm_runtime_get_if_in_use -- drivers/media/i2c/ | \ xargs perl -i -pe 's/(pm_runtime_get_if_in_use\(.*\)) \<\= 0/!$1/' Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c/ov13858.c')
-rw-r--r--drivers/media/i2c/ov13858.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c
index 5f601255a296..c8bbc1f52261 100644
--- a/drivers/media/i2c/ov13858.c
+++ b/drivers/media/i2c/ov13858.c
@@ -1230,7 +1230,7 @@ static int ov13858_set_ctrl(struct v4l2_ctrl *ctrl)
* Applying V4L2 control value only happens
* when power is up for streaming
*/
- if (pm_runtime_get_if_in_use(&client->dev) <= 0)
+ if (!pm_runtime_get_if_in_use(&client->dev))
return 0;
ret = 0;