@@ -391,7 +391,8 @@ static int prp_s_stream(struct v4l2_subdev *sd, int enable)
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;
@@ -1140,7 +1140,8 @@ static int prp_s_stream(struct v4l2_subdev *sd, int enable)
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;
@@ -863,7 +863,8 @@ static int csi_s_stream(struct v4l2_subdev *sd, int enable)
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;
@@ -536,7 +536,8 @@ static int vdic_s_stream(struct v4l2_subdev *sd, int enable)
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;
@@ -397,7 +397,8 @@ static int csi2_s_stream(struct v4l2_subdev *sd, int enable)
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;