media: i2c: Fix pm_runtime_get_if_in_use() usage in sensor drivers
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 30 Jul 2018 11:44:43 +0000 (07:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:45:46 +0000 (18:45 +0100)
commitb489c1e010e49023e5ae0f912c02c53a3720a4c6
tree8a5067a544eef4f9662d6c504ac529ff039b7d74
parent5a21c7a0b59288a6296f892ab0d1a7977b088796
media: i2c: Fix pm_runtime_get_if_in_use() usage in sensor drivers

[ Upstream commit 4d471563d87b2b83e73b8abffb9273950e6d2e36 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ov13858.c
drivers/media/i2c/ov2685.c
drivers/media/i2c/ov5670.c
drivers/media/i2c/ov5695.c
drivers/media/i2c/ov7740.c