summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-12-03 22:44:00 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-02-08 10:24:35 +0300
commit4272fd7ae69aef86aa4c9f7d49a9d15beb50547e (patch)
treecdeaeee2a56cea233706c3578db07a98708dc215 /drivers/staging
parentaec221279a2934de5fbfb8d553fcedb522772d8f (diff)
downloadlinux-4272fd7ae69aef86aa4c9f7d49a9d15beb50547e.tar.xz
media: atomisp: ov2722: Don't take the input_lock for try_fmt calls.
On ov2722_set_fmt() calls with format->which == V4L2_SUBDEV_FORMAT_TRY, ov2722_set_fmt() does not talk to the sensor, so there is no need to lock the dev->input_lock mutex in this case. Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/i2c/atomisp-ov2722.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
index 83d036b5d772..e09c80d1f9ec 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
@@ -651,7 +651,6 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd,
if (!ov2722_info)
return -EINVAL;
- mutex_lock(&dev->input_lock);
res = v4l2_find_nearest_size(ov2722_res_preview,
ARRAY_SIZE(ov2722_res_preview), width,
height, fmt->width, fmt->height);
@@ -665,10 +664,10 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd,
fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
sd_state->pads->try_fmt = *fmt;
- mutex_unlock(&dev->input_lock);
return 0;
}
+ mutex_lock(&dev->input_lock);
dev->pixels_per_line = dev->res->pixels_per_line;
dev->lines_per_frame = dev->res->lines_per_frame;