public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] lgdt3306a: remove 20*50 msec unnecessary timeout
@ 2016-07-25 18:38 Abylay Ospan
  2016-07-25 18:55 ` Michael Ira Krufky
  0 siblings, 1 reply; 7+ messages in thread
From: Abylay Ospan @ 2016-07-25 18:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Abylay Ospan

inside lgdt3306a_search we reading demod status 20 times with 50 msec sleep after each read.
This gives us more than 1 sec of delay. Removing this delay should not affect demod functionality.

Signed-off-by: Abylay Ospan <aospan@netup.ru>
---
 drivers/media/dvb-frontends/lgdt3306a.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c
index 179c26e..dad7ad3 100644
--- a/drivers/media/dvb-frontends/lgdt3306a.c
+++ b/drivers/media/dvb-frontends/lgdt3306a.c
@@ -1737,24 +1737,16 @@ static int lgdt3306a_get_tune_settings(struct dvb_frontend *fe,
 static int lgdt3306a_search(struct dvb_frontend *fe)
 {
 	enum fe_status status = 0;
-	int i, ret;
+	int ret;
 
 	/* set frontend */
 	ret = lgdt3306a_set_parameters(fe);
 	if (ret)
 		goto error;
 
-	/* wait frontend lock */
-	for (i = 20; i > 0; i--) {
-		dbg_info(": loop=%d\n", i);
-		msleep(50);
-		ret = lgdt3306a_read_status(fe, &status);
-		if (ret)
-			goto error;
-
-		if (status & FE_HAS_LOCK)
-			break;
-	}
+	ret = lgdt3306a_read_status(fe, &status);
+	if (ret)
+		goto error;
 
 	/* check if we have a valid signal */
 	if (status & FE_HAS_LOCK)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-26 11:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 18:38 [PATCH] [media] lgdt3306a: remove 20*50 msec unnecessary timeout Abylay Ospan
2016-07-25 18:55 ` Michael Ira Krufky
2016-07-25 19:26   ` Abylay Ospan
2016-07-25 19:28   ` Mauro Carvalho Chehab
2016-07-25 19:37     ` Michael Ira Krufky
2016-07-26  1:36       ` Mauro Carvalho Chehab
2016-07-26 11:11         ` Michael Ira Krufky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox