Re: [PATCH 1/7] v4l2: replace enum_mbus_fmt by enum_mbus_code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 9 Apr 2015, Hans Verkuil wrote:

> From: Hans Verkuil <hans.verkuil@xxxxxxxxx>
> 
> Replace all calls to the enum_mbus_fmt video op by the pad
> enum_mbus_code op and remove the duplicate video op.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>
> Cc: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
> Cc: Scott Jiang <scott.jiang.linux@xxxxxxxxx>
> Cc: Jonathan Corbet <corbet@xxxxxxx>
> Cc: Kamil Debski <k.debski@xxxxxxxxxxx>
> ---

[snip]

> diff --git a/drivers/media/i2c/soc_camera/mt9m111.c b/drivers/media/i2c/soc_camera/mt9m111.c
> index 441e0fd..ef8682c 100644
> --- a/drivers/media/i2c/soc_camera/mt9m111.c
> +++ b/drivers/media/i2c/soc_camera/mt9m111.c
> @@ -839,13 +839,14 @@ static struct v4l2_subdev_core_ops mt9m111_subdev_core_ops = {
>  #endif
>  };
>  
> -static int mt9m111_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
> -			    u32 *code)
> +static int mt9m111_enum_mbus_code(struct v4l2_subdev *sd,
> +		struct v4l2_subdev_pad_config *cfg,
> +		struct v4l2_subdev_mbus_code_enum *code)
>  {
> -	if (index >= ARRAY_SIZE(mt9m111_colour_fmts))
> +	if (code->code || code->index >= ARRAY_SIZE(mt9m111_colour_fmts))

Didn't you mean 

+	if (code->pad || code->index >= ARRAY_SIZE(mt9m111_colour_fmts))

?

>  		return -EINVAL;
>  
> -	*code = mt9m111_colour_fmts[index].code;
> +	code->code = mt9m111_colour_fmts[code->index].code;
>  	return 0;
>  }
>  
> @@ -871,13 +872,17 @@ static struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = {
>  	.s_crop		= mt9m111_s_crop,
>  	.g_crop		= mt9m111_g_crop,
>  	.cropcap	= mt9m111_cropcap,
> -	.enum_mbus_fmt	= mt9m111_enum_fmt,
>  	.g_mbus_config	= mt9m111_g_mbus_config,
>  };
>  
> +static const struct v4l2_subdev_pad_ops mt9m111_subdev_pad_ops = {
> +	.enum_mbus_code = mt9m111_enum_mbus_code,
> +};
> +
>  static struct v4l2_subdev_ops mt9m111_subdev_ops = {
>  	.core	= &mt9m111_subdev_core_ops,
>  	.video	= &mt9m111_subdev_video_ops,
> +	.pad	= &mt9m111_subdev_pad_ops,
>  };
>  
>  /*

[snip]

Apart from that for soc-camera:

Acked-by: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>

Thanks
Guennadi
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux