media: rcar-vin: Do not try to stop stream if not running

Do not attempt to stop the streaming if the stream is not running.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Niklas Söderlund 2021-01-15 01:21:45 +01:00 committed by Mauro Carvalho Chehab
parent b7da24739f
commit c4f115355c
1 changed files with 5 additions and 0 deletions

View File

@ -1301,6 +1301,11 @@ void rvin_stop_streaming(struct rvin_dev *vin)
spin_lock_irqsave(&vin->qlock, flags);
if (vin->state == STOPPED) {
spin_unlock_irqrestore(&vin->qlock, flags);
return;
}
vin->state = STOPPING;
/* Wait until only scratch buffer is used, max 3 interrupts. */