This is a note to let you know that the patch titled
        Subject: V4L/DVB: [STV090x] Code simplification
        Author:  Manu Abraham <[email protected]>
Were queued at http://git.linuxtv.org/v4l-dvb.git

 - Remove a redundant exported gate control function

Signed-off-by: Manu Abraham <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb/frontends/stv090x.c |   57 +++++++++++++++-----------------
 1 files changed, 27 insertions(+), 30 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=4c66581b279cdd6311756f24eab27a4d5a121e4c

diff --git a/drivers/media/dvb/frontends/stv090x.c 
b/drivers/media/dvb/frontends/stv090x.c
index c52c335..80e1acc 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -753,9 +753,8 @@ static int stv090x_write_reg(struct stv090x_state *state, 
unsigned int reg, u8 d
        return stv090x_write_regs(state, reg, &data, 1);
 }
 
-static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
+static int stv090x_i2c_gate_ctrl(struct stv090x_state *state, int enable)
 {
-       struct stv090x_state *state = fe->demodulator_priv;
        u32 reg;
 
        if (enable)
@@ -1777,7 +1776,7 @@ static u32 stv090x_srate_srch_coarse(struct stv090x_state 
*state)
                                freq -= cur_step * car_step;
 
                        /* Setup tuner */
-                       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+                       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                                goto err;
 
                        if (state->config->tuner_set_frequency) {
@@ -1790,12 +1789,12 @@ static u32 stv090x_srate_srch_coarse(struct 
stv090x_state *state)
                                        goto err_gateoff;
                        }
 
-                       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+                       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                                goto err;
 
                        msleep(50);
 
-                       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+                       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                                goto err;
 
                        if (state->config->tuner_get_status) {
@@ -1808,7 +1807,7 @@ static u32 stv090x_srate_srch_coarse(struct stv090x_state 
*state)
                        else
                                dprintk(FE_DEBUG, 1, "Tuner unlocked");
 
-                       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+                       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                                goto err;
 
                }
@@ -1821,7 +1820,7 @@ static u32 stv090x_srate_srch_coarse(struct stv090x_state 
*state)
        return srate_coarse;
 
 err_gateoff:
-       stv090x_i2c_gate_ctrl(fe, 0);
+       stv090x_i2c_gate_ctrl(state, 0);
 err:
        dprintk(FE_ERROR, 1, "I/O error");
        return -1;
@@ -2166,7 +2165,7 @@ static int stv090x_get_coldlock(struct stv090x_state 
*state, s32 timeout_dmd)
                                                freq -= cur_step * car_step;
 
                                        /* Setup tuner */
-                                       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+                                       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                                                goto err;
 
                                        if (state->config->tuner_set_frequency) 
{
@@ -2179,12 +2178,12 @@ static int stv090x_get_coldlock(struct stv090x_state 
*state, s32 timeout_dmd)
                                                        goto err_gateoff;
                                        }
 
-                                       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+                                       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                                                goto err;
 
                                        msleep(50);
 
-                                       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+                                       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                                                goto err;
 
                                        if (state->config->tuner_get_status) {
@@ -2197,7 +2196,7 @@ static int stv090x_get_coldlock(struct stv090x_state 
*state, s32 timeout_dmd)
                                        else
                                                dprintk(FE_DEBUG, 1, "Tuner 
unlocked");
 
-                                       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+                                       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                                                goto err;
 
                                        STV090x_WRITE_DEMOD(state, DMDISTATE, 
0x1c);
@@ -2221,7 +2220,7 @@ static int stv090x_get_coldlock(struct stv090x_state 
*state, s32 timeout_dmd)
        return lock;
 
 err_gateoff:
-       stv090x_i2c_gate_ctrl(fe, 0);
+       stv090x_i2c_gate_ctrl(state, 0);
 err:
        dprintk(FE_ERROR, 1, "I/O error");
        return -1;
@@ -2590,7 +2589,7 @@ static enum stv090x_signal_state 
stv090x_get_sig_params(struct stv090x_state *st
        }
        state->delsys = stv090x_get_std(state);
 
-       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                goto err;
 
        if (state->config->tuner_get_frequency) {
@@ -2598,7 +2597,7 @@ static enum stv090x_signal_state 
stv090x_get_sig_params(struct stv090x_state *st
                        goto err_gateoff;
        }
 
-       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                goto err;
 
        offst_freq = stv090x_get_car_freq(state, state->internal->mclk) / 1000;
@@ -2618,7 +2617,7 @@ static enum stv090x_signal_state 
stv090x_get_sig_params(struct stv090x_state *st
 
        if ((state->algo == STV090x_BLIND_SEARCH) || (state->srate < 10000000)) 
{
 
-               if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+               if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                        goto err;
 
                if (state->config->tuner_get_frequency) {
@@ -2626,7 +2625,7 @@ static enum stv090x_signal_state 
stv090x_get_sig_params(struct stv090x_state *st
                                goto err_gateoff;
                }
 
-               if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+               if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                        goto err;
 
                if (abs(offst_freq) <= ((state->search_range / 2000) + 500))
@@ -2645,7 +2644,7 @@ static enum stv090x_signal_state 
stv090x_get_sig_params(struct stv090x_state *st
        return STV090x_OUTOFRANGE;
 
 err_gateoff:
-       stv090x_i2c_gate_ctrl(fe, 0);
+       stv090x_i2c_gate_ctrl(state, 0);
 err:
        dprintk(FE_ERROR, 1, "I/O error");
        return -1;
@@ -2999,7 +2998,7 @@ static int stv090x_optimize_track(struct stv090x_state 
*state)
 
                        if (state->algo != STV090x_WARM_SEARCH) {
 
-                               if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+                               if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                                        goto err;
 
                                if (state->config->tuner_set_bandwidth) {
@@ -3007,7 +3006,7 @@ static int stv090x_optimize_track(struct stv090x_state 
*state)
                                                goto err_gateoff;
                                }
 
-                               if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+                               if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                                        goto err;
 
                        }
@@ -3058,7 +3057,7 @@ static int stv090x_optimize_track(struct stv090x_state 
*state)
        return 0;
 
 err_gateoff:
-       stv090x_i2c_gate_ctrl(fe, 0);
+       stv090x_i2c_gate_ctrl(state, 0);
 err:
        dprintk(FE_ERROR, 1, "I/O error");
        return -1;
@@ -3234,7 +3233,7 @@ static enum stv090x_signal_state stv090x_algo(struct 
stv090x_state *state)
        }
 
        /* Setup tuner */
-       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                goto err;
 
        if (state->config->tuner_set_bbgain) {
@@ -3255,17 +3254,17 @@ static enum stv090x_signal_state stv090x_algo(struct 
stv090x_state *state)
                        goto err_gateoff;
        }
 
-       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                goto err;
 
        msleep(50);
 
        if (state->config->tuner_get_status) {
-               if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+               if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                        goto err;
                if (state->config->tuner_get_status(fe, &reg) < 0)
                        goto err_gateoff;
-               if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+               if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                        goto err;
 
                if (reg)
@@ -3399,7 +3398,7 @@ static enum stv090x_signal_state stv090x_algo(struct 
stv090x_state *state)
        return signal_state;
 
 err_gateoff:
-       stv090x_i2c_gate_ctrl(fe, 0);
+       stv090x_i2c_gate_ctrl(state, 0);
 err:
        dprintk(FE_ERROR, 1, "I/O error");
        return -1;
@@ -4335,7 +4334,7 @@ static int stv090x_init(struct dvb_frontend *fe)
        if (STV090x_WRITE_DEMOD(state, DEMOD, reg) < 0)
                goto err;
 
-       if (stv090x_i2c_gate_ctrl(fe, 1) < 0)
+       if (stv090x_i2c_gate_ctrl(state, 1) < 0)
                goto err;
 
        if (config->tuner_set_mode) {
@@ -4348,7 +4347,7 @@ static int stv090x_init(struct dvb_frontend *fe)
                        goto err_gateoff;
        }
 
-       if (stv090x_i2c_gate_ctrl(fe, 0) < 0)
+       if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                goto err;
 
        if (stv090x_set_tspath(state) < 0)
@@ -4357,7 +4356,7 @@ static int stv090x_init(struct dvb_frontend *fe)
        return 0;
 
 err_gateoff:
-       stv090x_i2c_gate_ctrl(fe, 0);
+       stv090x_i2c_gate_ctrl(state, 0);
 err:
        dprintk(FE_ERROR, 1, "I/O error");
        return -1;
@@ -4498,8 +4497,6 @@ static struct dvb_frontend_ops stv090x_ops = {
        .sleep                          = stv090x_sleep,
        .get_frontend_algo              = stv090x_frontend_algo,
 
-       .i2c_gate_ctrl                  = stv090x_i2c_gate_ctrl,
-
        .diseqc_send_master_cmd         = stv090x_send_diseqc_msg,
        .diseqc_send_burst              = stv090x_send_diseqc_burst,
        .diseqc_recv_slave_reply        = stv090x_recv_slave_reply,

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to