V4L/DVB: [STV090x, STV6110x] Use tuner sleep within the demodulator control

Oliver Endriss <o.endriss@gmx.de> pointed out:
Imho not a good idea, as the frontend thread calls
- fe->ops.tuner_ops.init
- fe->ops.tuner_ops.sleep

If you remove fe->ops.i2c_gate_ctrl, init and sleep will fail,
because gate_ctrl was never called...

--

Signed-off-by: Manu Abraham <manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index 0af1708..a80a34b 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -3838,6 +3838,11 @@
 	struct stv090x_state *state = fe->demodulator_priv;
 	u32 reg;
 
+	if (state->config->tuner_init) {
+		if (state->config->tuner_sleep(fe) < 0)
+			goto err_gateoff;
+	}
+
 	dprintk(FE_DEBUG, 1, "Set %s to sleep",
 		state->device == STV0900 ? "STV0900" : "STV0903");
 
@@ -3852,6 +3857,9 @@
 		goto err;
 
 	return 0;
+
+err_gateoff:
+	stv090x_i2c_gate_ctrl(state, 0);
 err:
 	dprintk(FE_ERROR, 1, "I/O error");
 	return -1;