Commit ab614f27 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

media: ov5647: Protect s_stream() with mutex

Use the driver mutex to protect s_stream() operations.
This will become more relevant once the sensor will support more formats
and set_format() could be issue concurrently to s_stream().
Signed-off-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 464090c0
...@@ -462,10 +462,17 @@ static const struct v4l2_subdev_core_ops ov5647_subdev_core_ops = { ...@@ -462,10 +462,17 @@ static const struct v4l2_subdev_core_ops ov5647_subdev_core_ops = {
static int ov5647_s_stream(struct v4l2_subdev *sd, int enable) static int ov5647_s_stream(struct v4l2_subdev *sd, int enable)
{ {
struct ov5647 *sensor = to_state(sd);
int ret;
mutex_lock(&sensor->lock);
if (enable) if (enable)
return ov5647_stream_on(sd); ret = ov5647_stream_on(sd);
else else
return ov5647_stream_off(sd); ret = ov5647_stream_off(sd);
mutex_unlock(&sensor->lock);
return ret;
} }
static const struct v4l2_subdev_video_ops ov5647_subdev_video_ops = { static const struct v4l2_subdev_video_ops ov5647_subdev_video_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment