media: ov7251: Fix multiple problems in s_stream callback
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 18 May 2022 15:52:36 +0000 (16:52 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 14:12:17 +0000 (15:12 +0100)
commitfda0f59a3aa41e0b724301747802e6ebeddae42a
tree320cd6569d184f825cf3467d391d7a4adddcc782
parent576d196c522bd0e17bf9c5ff92ef963c0960a201
media: ov7251: Fix multiple problems in s_stream callback

The s_stream callback had several issues:

- If pm_runtime_get_sync() fails, the usage_count is not put.

- The sensor wasn't suspended if s_stream(subdev, 1) failed.

Fix this.

Fixes: ("media: i2c: Add pm_runtime support to ov7251")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/ov7251.c