[media] af9033: feed clock to RF tuner
[cascardo/linux.git] / drivers / media / dvb-frontends / stb6100_proc.h
index 112163a..bd8a0ec 100644 (file)
 
 static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency)
 {
-       struct dvb_frontend_ops *frontend_ops = NULL;
-       struct dvb_tuner_ops    *tuner_ops = NULL;
+       struct dvb_frontend_ops *frontend_ops = &fe->ops;
+       struct dvb_tuner_ops    *tuner_ops = &frontend_ops->tuner_ops;
        struct tuner_state      state;
        int err = 0;
 
-       if (&fe->ops)
-               frontend_ops = &fe->ops;
-       if (&frontend_ops->tuner_ops)
-               tuner_ops = &frontend_ops->tuner_ops;
        if (tuner_ops->get_state) {
                if (frontend_ops->i2c_gate_ctrl)
                        frontend_ops->i2c_gate_ctrl(fe, 1);
@@ -49,16 +45,13 @@ static int stb6100_get_freq(struct dvb_frontend *fe, u32 *frequency)
 
 static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency)
 {
-       struct dvb_frontend_ops *frontend_ops = NULL;
-       struct dvb_tuner_ops    *tuner_ops = NULL;
+       struct dvb_frontend_ops *frontend_ops = &fe->ops;
+       struct dvb_tuner_ops    *tuner_ops = &frontend_ops->tuner_ops;
        struct tuner_state      state;
        int err = 0;
 
        state.frequency = frequency;
-       if (&fe->ops)
-               frontend_ops = &fe->ops;
-       if (&frontend_ops->tuner_ops)
-               tuner_ops = &frontend_ops->tuner_ops;
+
        if (tuner_ops->set_state) {
                if (frontend_ops->i2c_gate_ctrl)
                        frontend_ops->i2c_gate_ctrl(fe, 1);
@@ -79,15 +72,11 @@ static int stb6100_set_freq(struct dvb_frontend *fe, u32 frequency)
 
 static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth)
 {
-       struct dvb_frontend_ops *frontend_ops = NULL;
-       struct dvb_tuner_ops    *tuner_ops = NULL;
+       struct dvb_frontend_ops *frontend_ops = &fe->ops;
+       struct dvb_tuner_ops    *tuner_ops = &frontend_ops->tuner_ops;
        struct tuner_state      state;
        int err = 0;
 
-       if (&fe->ops)
-               frontend_ops = &fe->ops;
-       if (&frontend_ops->tuner_ops)
-               tuner_ops = &frontend_ops->tuner_ops;
        if (tuner_ops->get_state) {
                if (frontend_ops->i2c_gate_ctrl)
                        frontend_ops->i2c_gate_ctrl(fe, 1);
@@ -109,16 +98,13 @@ static int stb6100_get_bandw(struct dvb_frontend *fe, u32 *bandwidth)
 
 static int stb6100_set_bandw(struct dvb_frontend *fe, u32 bandwidth)
 {
-       struct dvb_frontend_ops *frontend_ops = NULL;
-       struct dvb_tuner_ops    *tuner_ops = NULL;
+       struct dvb_frontend_ops *frontend_ops = &fe->ops;
+       struct dvb_tuner_ops    *tuner_ops = &frontend_ops->tuner_ops;
        struct tuner_state      state;
        int err = 0;
 
        state.bandwidth = bandwidth;
-       if (&fe->ops)
-               frontend_ops = &fe->ops;
-       if (&frontend_ops->tuner_ops)
-               tuner_ops = &frontend_ops->tuner_ops;
+
        if (tuner_ops->set_state) {
                if (frontend_ops->i2c_gate_ctrl)
                        frontend_ops->i2c_gate_ctrl(fe, 1);