summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ov7251.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2022-05-18 16:52:36 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-08 15:12:17 +0100
commitfda0f59a3aa41e0b724301747802e6ebeddae42a (patch)
tree320cd6569d184f825cf3467d391d7a4adddcc782 /drivers/media/i2c/ov7251.c
parent576d196c522bd0e17bf9c5ff92ef963c0960a201 (diff)
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>
Diffstat (limited to 'drivers/media/i2c/ov7251.c')
-rw-r--r--drivers/media/i2c/ov7251.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 0e7be15bc20a..603a4c7049e6 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1340,7 +1340,7 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
if (enable) {
ret = pm_runtime_get_sync(ov7251->dev);
if (ret < 0)
- goto unlock_out;
+ goto err_power_down;
ret = ov7251_pll_configure(ov7251);
if (ret) {
@@ -1372,12 +1372,11 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
pm_runtime_put(ov7251->dev);
}
-unlock_out:
mutex_unlock(&ov7251->lock);
return ret;
err_power_down:
- pm_runtime_put_noidle(ov7251->dev);
+ pm_runtime_put(ov7251->dev);
mutex_unlock(&ov7251->lock);
return ret;
}