vc04_services: bcm2835-codec: Remove redundant role check
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Mon, 3 Oct 2022 13:21:35 +0000 (14:21 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Mon, 3 Oct 2022 13:49:02 +0000 (14:49 +0100)
vidioc_try_encoder_cmd checks the role, but the ioctl is disabled
for any roles in which it is invalid.

Remove the redundant check.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c

index ca063a2..be70be1 100644 (file)
@@ -2463,9 +2463,6 @@ static int vidioc_try_encoder_cmd(struct file *file, void *priv,
 {
        struct bcm2835_codec_ctx *ctx = file2ctx(file);
 
-       if (ctx->dev->role != ENCODE && ctx->dev->role != ENCODE_IMAGE)
-               return -EINVAL;
-
        switch (cmd->cmd) {
        case V4L2_ENC_CMD_STOP:
                break;