summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/mt9m111.c
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2018-11-27 11:02:49 +0100
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-12-05 12:38:18 +0100
commit3c437901bd83d236e4349d93bf5d3d814b8f6357 (patch)
treeb3c6456310fe6ba0d7077d6e24db8af676ba2072 /drivers/media/i2c/mt9m111.c
parentmedia: mt9m111: add s_stream callback (diff)
downloadlinux-3c437901bd83d236e4349d93bf5d3d814b8f6357.tar.xz
linux-3c437901bd83d236e4349d93bf5d3d814b8f6357.zip
media: mt9m111: add streaming check to set_fmt
Currently set_fmt don't care about the streaming status, so the format can be changed during streaming. This can lead into wrong behaviours. Check if the device is already streaming and return -EBUSY to avoid wrong behaviours. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/media/i2c/mt9m111.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 03559669de9f..9b0a3689fa98 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -563,6 +563,9 @@ static int mt9m111_set_fmt(struct v4l2_subdev *sd,
bool bayer;
int ret;
+ if (mt9m111->is_streaming)
+ return -EBUSY;
+
if (format->pad)
return -EINVAL;