Re: [PATCH] tw9910: color format check is added on set_fmt

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

 



On Tue, 27 Jan 2009, Kuninori Morimoto wrote:

> 
> Signed-off-by: Kuninori Morimoto <morimoto.kuninori@xxxxxxxxxxx>

Why is this needed? Do you see any possibility for tw9910 to be called 
with an unsupported format?

Thanks
Guennadi

> ---
>  drivers/media/video/tw9910.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
> index 1a9c6fd..57027c0 100644
> --- a/drivers/media/video/tw9910.c
> +++ b/drivers/media/video/tw9910.c
> @@ -647,6 +647,19 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
>  	struct tw9910_priv *priv = container_of(icd, struct tw9910_priv, icd);
>  	int                 ret  = -EINVAL;
>  	u8                  val;
> +	int                 i;
> +
> +	/*
> +	 * check color format
> +	 */
> +	for (i = 0 ; i < ARRAY_SIZE(tw9910_color_fmt) ; i++) {
> +		if (pixfmt == tw9910_color_fmt[i].fourcc) {
> +			ret = 0;
> +			break;
> +		}
> +	}
> +	if (ret < 0)
> +		goto tw9910_set_fmt_error;
>  
>  	/*
>  	 * select suitable norm
> -- 
> 1.5.6.3
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
--
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