There is no need to copy the bitrate mode to a field in the channel and the value can be read directly from the control. Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx> --- drivers/staging/media/allegro-dvt/allegro-core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c index c25f76fffa5e..8c26158eab93 100644 --- a/drivers/staging/media/allegro-dvt/allegro-core.c +++ b/drivers/staging/media/allegro-dvt/allegro-core.c @@ -197,7 +197,6 @@ struct allegro_channel { unsigned int sizeimage_encoded; unsigned int csequence; - enum v4l2_mpeg_video_bitrate_mode bitrate_mode; bool frame_rc_enable; unsigned int bitrate; unsigned int bitrate_peak; @@ -1137,7 +1136,7 @@ static int allegro_mcu_send_create_channel(struct allegro_dev *dev, if (channel->frame_rc_enable) msg.rate_control_mode = - v4l2_bitrate_mode_to_mcu_mode(channel->bitrate_mode); + v4l2_bitrate_mode_to_mcu_mode(v4l2_ctrl_g_ctrl(channel->mpeg_video_bitrate_mode)); else msg.rate_control_mode = 0; @@ -2206,7 +2205,6 @@ static void allegro_set_default_params(struct allegro_channel *channel) channel->sizeimage_encoded = estimate_stream_size(channel->width, channel->height); - channel->bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_CBR; channel->bitrate = maximum_bitrate(channel->level); channel->bitrate_peak = maximum_bitrate(channel->level); channel->cpb_size = maximum_cpb_size(channel->level); @@ -2403,9 +2401,6 @@ static int allegro_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE: channel->frame_rc_enable = ctrl->val; break; - case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: - channel->bitrate_mode = ctrl->val; - break; case V4L2_CID_MPEG_VIDEO_BITRATE: channel->bitrate = ctrl->val; break; @@ -2496,7 +2491,7 @@ static int allegro_open(struct file *file) &allegro_ctrl_ops, V4L2_CID_MPEG_VIDEO_BITRATE_MODE, V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, 0, - channel->bitrate_mode); + V4L2_MPEG_VIDEO_BITRATE_MODE_CBR); channel->mpeg_video_bitrate = v4l2_ctrl_new_std(handler, &allegro_ctrl_ops, V4L2_CID_MPEG_VIDEO_BITRATE, -- 2.20.1