From: Marco Felsch <m.felsch@pengutronix.de>
To: mchehab@kernel.org, sakari.ailus@linux.intel.com,
robh+dt@kernel.org, mark.rutland@arm.com
Cc: enrico.scholz@sigma-chemnitz.de, akinobu.mita@gmail.com,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
graphics@pengutronix.de
Subject: [PATCH v2 2/6] media: mt9m111: add streaming check to set_fmt
Date: Mon, 29 Oct 2018 19:24:06 +0100 [thread overview]
Message-ID: <20181029182410.18783-3-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20181029182410.18783-1-m.felsch@pengutronix.de>
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
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>
---
drivers/media/i2c/mt9m111.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index e0ac5aa6ea64..1f8789fe28af 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -560,6 +560,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;
--
2.19.1
next prev parent reply other threads:[~2018-10-29 18:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 18:24 [PATCH v2 0/6] media: mt9m111 features Marco Felsch
2018-10-29 18:24 ` [PATCH v2 1/6] media: mt9m111: add s_stream callback Marco Felsch
2018-10-29 18:24 ` Marco Felsch [this message]
2018-10-29 18:24 ` [PATCH v2 3/6] media: mt9m111: add support to select formats and fps for {Q,SXGA} Marco Felsch
2018-11-16 13:26 ` Sakari Ailus
2018-11-16 13:31 ` Hans Verkuil
2018-11-16 13:33 ` Sakari Ailus
2018-11-26 16:01 ` Marco Felsch
2018-10-29 18:24 ` [PATCH v2 4/6] media: mt9m111: allow to setup pixclk polarity Marco Felsch
2018-11-16 13:32 ` Sakari Ailus
2018-11-26 14:16 ` Marco Felsch
2018-10-29 18:24 ` [PATCH v2 5/6] dt-bindings: media: mt9m111: adapt documentation to be more clear Marco Felsch
2018-10-30 22:30 ` Rob Herring
2018-10-29 18:24 ` [PATCH v2 6/6] dt-bindings: media: mt9m111: add pclk-sample property Marco Felsch
2018-10-30 22:31 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181029182410.18783-3-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=akinobu.mita@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=enrico.scholz@sigma-chemnitz.de \
--cc=graphics@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=m.grzeschik@pengutronix.de \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).