v4l/tvp514x: try_count reaches 0, not -1
PATCH 1/1 v4l/tvp514x: try_count reaches 0, not -1
with while (try_count-- > 0) { ... } try_count reaches 0, not -1.
---
drivers/media/video/tvp514x.c +1 -1
@@ -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;
Thanks,
Vaibhav Hiremath
Quoted 9 lines
-----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_countreaches 0, not -1with while (try_count-- > 0) { ... }
try_countreaches 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.
Quoted 16 lines
Signed-off-by Roel Kluin <[email protected]>---
drivers/media/video/tvp514x.c +1
-1@@ -686,7 +686,7 @@ static int ioctl_s_routing(structv4l2_int_device *s, break;/* Input detected */ } -if ((current_std ==STD_INVALID ) || (try_count <0 )) +if ((current_std ==STD_INVALID ) || (try_count <=0 ))return -EINVAL ;
Quoted 1 line
decoder->current_std=current_std;
[Hiremath, Vaibhav] I believe we don't need this fix here.
Quoted 1 line · Roel Kluin
with while (try_count-- > 0) { ... }
try_countreaches 0, not -1.
Sorry but this is bogus, please ignore.