Thanks,
Vaibhav Hiremath

> -----Original Message-----
> From: Roel Kluin [mailto:[email protected]]
> Sent: Tuesday, February 10, 2009 3:27 AM
> To: Hiremath, Vaibhav; [email protected]
> Cc: [email protected]; [email protected]
> 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 <[email protected]>
> ---
> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to