public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 03/37] dvb: stv0299: revert improper method
@ 2005-11-01  8:12 Michael Krufky
  2005-11-03  2:26 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Krufky @ 2005-11-01  8:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-dvb-maintainer

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]




[-- Attachment #2: 2359.patch --]
[-- Type: text/x-patch, Size: 1693 bytes --]

From: Andrew de Quincey <adq_dvb@lidskialf.net>

Remove my badly thought out patch. This does need done, but in a proper way.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>

 drivers/media/dvb/frontends/stv0299.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- linux-2.6.14-git3.orig/drivers/media/dvb/frontends/stv0299.c
+++ linux-2.6.14-git3/drivers/media/dvb/frontends/stv0299.c
@@ -64,8 +64,12 @@
 	u32 tuner_frequency;
 	u32 symbol_rate;
 	fe_code_rate_t fec_inner;
+	int errmode;
 };
 
+#define STATUS_BER 0
+#define STATUS_UCBLOCKS 1
+
 static int debug;
 static int debug_legacy_dish_switch;
 #define dprintk(args...) \
@@ -517,8 +521,7 @@
 {
         struct stv0299_state* state = fe->demodulator_priv;
 
-	stv0299_writeregI(state, 0x34, (stv0299_readreg(state, 0x34) & 0xcf) | 0x10);
-	msleep(100);
+	if (state->errmode != STATUS_BER) return 0;
 	*ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
 
 	return 0;
@@ -557,9 +560,8 @@
 {
         struct stv0299_state* state = fe->demodulator_priv;
 
-	stv0299_writeregI(state, 0x34, (stv0299_readreg(state, 0x34) & 0xcf) | 0x30);
-	msleep(100);
-	*ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
+	if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0;
+	else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);
 
 	return 0;
 }
@@ -708,6 +710,7 @@
 	state->tuner_frequency = 0;
 	state->symbol_rate = 0;
 	state->fec_inner = 0;
+	state->errmode = STATUS_BER;
 
 	/* check if the demod is there */
 	stv0299_writeregI(state, 0x02, 0x34); /* standby off */


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

* Re: [PATCH 03/37] dvb: stv0299: revert improper method
  2005-11-01  8:12 [PATCH 03/37] dvb: stv0299: revert improper method Michael Krufky
@ 2005-11-03  2:26 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2005-11-03  2:26 UTC (permalink / raw)
  To: Michael Krufky; +Cc: linux-kernel, linux-dvb-maintainer

Michael Krufky <mkrufky@m1k.net> wrote:
>
>  +	if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0;
>  +	else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);

Preferred kernel tyle is

	if (expr)
		statement;
	else
		statement;

please.

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

end of thread, other threads:[~2005-11-03  3:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01  8:12 [PATCH 03/37] dvb: stv0299: revert improper method Michael Krufky
2005-11-03  2:26 ` Andrew Morton

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