Calling S_STREAM OFF multiple times on a video device is valid, although
dubious, practice. Instead of warning about it and setting stream count
lower than zero, just ignore the subsequent S_STREAM calls and correct
the stream count to zero.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
update_count:
priv->stream_count += enable ? 1 : -1;
- WARN_ON(priv->stream_count < 0);
+ if (priv->stream_count < 0)
+ priv->stream_count = 0;
out:
mutex_unlock(&priv->lock);
return ret;
update_count:
priv->stream_count += enable ? 1 : -1;
- WARN_ON(priv->stream_count < 0);
+ if (priv->stream_count < 0)
+ priv->stream_count = 0;
out:
mutex_unlock(&priv->lock);
return ret;
update_count:
priv->stream_count += enable ? 1 : -1;
- WARN_ON(priv->stream_count < 0);
+ if (priv->stream_count < 0)
+ priv->stream_count = 0;
out:
mutex_unlock(&priv->lock);
return ret;
update_count:
priv->stream_count += enable ? 1 : -1;
- WARN_ON(priv->stream_count < 0);
+ if (priv->stream_count < 0)
+ priv->stream_count = 0;
out:
mutex_unlock(&priv->lock);
return ret;
update_count:
csi2->stream_count += enable ? 1 : -1;
- WARN_ON(csi2->stream_count < 0);
+ if (csi2->stream_count < 0)
+ csi2->stream_count = 0;
out:
mutex_unlock(&csi2->lock);
return ret;