[media] m88rs2000 - only flip bit 2 on reg 0x70 on 16th try
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 14 May 2012 19:43:50 +0000 (16:43 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 20 May 2012 15:14:05 +0000 (12:14 -0300)
Continuous flip of bit2 reg 0x70 can cause device to become unresponsive.

Also correct reg read mistake.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/m88rs2000.c

index 0ad5bd8c1834c853d2b4f6d0a3ca154526ff09de..312588e84daeedf855ccc266b8484dbc13706ee0 100644 (file)
@@ -787,13 +787,13 @@ static int m88rs2000_set_frontend(struct dvb_frontend *fe)
                return -ENODEV;
 
        for (i = 0; i < 25; i++) {
-               u8 reg = m88rs2000_demod_read(state, 0x8c);
+               reg = m88rs2000_demod_read(state, 0x8c);
                if ((reg & 0x7) == 0x7) {
                        status = FE_HAS_LOCK;
                        break;
                }
                state->no_lock_count++;
-               if (state->no_lock_count > 15) {
+               if (state->no_lock_count == 15) {
                        reg = m88rs2000_demod_read(state, 0x70);
                        reg ^= 0x4;
                        m88rs2000_demod_write(state, 0x70, reg);