RE: [PATCH] v4l/tvp514x: try_count reaches 0, not -1

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

 




Thanks,
Vaibhav Hiremath

> -----Original Message-----
> From: Roel Kluin [mailto:roel.kluin@xxxxxxxxx]
> Sent: Tuesday, February 10, 2009 3:27 AM
> To: Hiremath, Vaibhav; mchehab@xxxxxxxxxx
> Cc: linux-media@xxxxxxxxxxxxxxx; video4linux-list@xxxxxxxxxx
> Subject: [PATCH] v4l/tvp514x: try_count reaches 0, not -1
> 
> with while (try_count-- > 0) { ... } try_count reaches 0, not -1.
> 
[Hiremath, Vaibhav] Please look at the loop,

        while (try_count-- > 0) {
		Wait till TVP locks the Signal.
        }

        if ((current_std == STD_INVALID) || (try_count < 0))
                return -EINVAL;

The above loop fails to lock the signal, and then the value of try_count will be -1 and not 0. The values 0-4 indicates the signal has been locked, provided that current_std != STD_INVALID.

> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> ---
> diff --git a/drivers/media/video/tvp514x.c
> b/drivers/media/video/tvp514x.c
> index 8e23aa5..5f4cbc2 100644
> --- a/drivers/media/video/tvp514x.c
> +++ b/drivers/media/video/tvp514x.c
> @@ -686,7 +686,7 @@ static int ioctl_s_routing(struct
> v4l2_int_device *s,
>  			break;	/* Input detected */
>  	}
> 
> -	if ((current_std == STD_INVALID) || (try_count < 0))
> +	if ((current_std == STD_INVALID) || (try_count <= 0))
>  		return -EINVAL;
> 
>  	decoder->current_std = current_std;

[Hiremath, Vaibhav] I believe we don't need this fix here.
--
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