aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/ir
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2019-02-17 10:17:47 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-02-18 15:38:23 -0500
commit12aceee1f412c3ddc7750155fec06c906f14ab51 (patch)
tree657e573eb3ed042f713bde06f718c14645f78199 /tools/testing/selftests/ir
parentmedia: vicodec: Add a flag for I-frames in fwht header (diff)
downloadwireguard-linux-12aceee1f412c3ddc7750155fec06c906f14ab51.tar.xz
wireguard-linux-12aceee1f412c3ddc7750155fec06c906f14ab51.zip
media: ov7740: fix runtime pm initialization
The runtime PM of this device is enabled after v4l2_ctrl_handler_setup(), and this makes this device's runtime PM usage count a negative value. The ov7740_set_ctrl() tries to do something only if the device's runtime PM usage counter is nonzero. ov7740_set_ctrl() { if (!pm_runtime_get_if_in_use(&client->dev)) return 0; <do something>; pm_runtime_put(&client->dev); return ret; } However, the ov7740_set_ctrl() is called by v4l2_ctrl_handler_setup() while the runtime PM of this device is not yet enabled. In this case, the pm_runtime_get_if_in_use() returns -EINVAL (!= 0). Therefore we can't bail out of this function and the usage count is decreased by pm_runtime_put() without increment. This fixes this problem by enabling the runtime PM of this device before v4l2_ctrl_handler_setup() so that the ov7740_set_ctrl() is always called when the runtime PM is enabled. Cc: Wenyou Yang <wenyou.yang@microchip.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'tools/testing/selftests/ir')
0 files changed, 0 insertions, 0 deletions