Warn if the stream is set ot a non-zero value on sub-device pad state access functions. A driver bug is required for triggering the warning. Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> --- drivers/media/v4l2-core/v4l2-subdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index bd0d89c2996f..b7d2de6e750a 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -1681,7 +1681,7 @@ __v4l2_subdev_state_get_format_stream(struct v4l2_subdev_state *state, return NULL; if (state->pads) { - if (stream) + if (WARN_ON(stream)) return NULL; if (WARN_ON(pad >= state->sd->entity.num_pads)) @@ -1715,7 +1715,7 @@ __v4l2_subdev_state_get_crop_stream(struct v4l2_subdev_state *state, return NULL; if (state->pads) { - if (stream) + if (WARN_ON(stream)) return NULL; if (WARN_ON(pad >= state->sd->entity.num_pads)) @@ -1749,7 +1749,7 @@ __v4l2_subdev_state_get_compose_stream(struct v4l2_subdev_state *state, return NULL; if (state->pads) { - if (stream) + if (WARN_ON(stream)) return NULL; if (WARN_ON(pad >= state->sd->entity.num_pads)) -- 2.39.2