diff options
Diffstat (limited to 'drivers/media/dvb-frontends/stb6100_cfg.h')
| -rw-r--r-- | drivers/media/dvb-frontends/stb6100_cfg.h | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/drivers/media/dvb-frontends/stb6100_cfg.h b/drivers/media/dvb-frontends/stb6100_cfg.h index 6314d18c797a..6edc15365847 100644 --- a/drivers/media/dvb-frontends/stb6100_cfg.h +++ b/drivers/media/dvb-frontends/stb6100_cfg.h | |||
| @@ -21,17 +21,14 @@ | |||
| 21 | 21 | ||
| 22 | static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency) | 22 | static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency) |
| 23 | { | 23 | { |
| 24 | struct dvb_frontend_ops *frontend_ops = NULL; | 24 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
| 25 | struct dvb_tuner_ops *tuner_ops = NULL; | 25 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
| 26 | struct tuner_state t_state; | 26 | struct tuner_state t_state; |
| 27 | int err = 0; | 27 | int err = 0; |
| 28 | 28 | ||
| 29 | if (&fe->ops) | ||
| 30 | frontend_ops = &fe->ops; | ||
| 31 | if (&frontend_ops->tuner_ops) | ||
| 32 | tuner_ops = &frontend_ops->tuner_ops; | ||
| 33 | if (tuner_ops->get_state) { | 29 | if (tuner_ops->get_state) { |
| 34 | if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) { | 30 | err = tuner_ops->get_state(fe, DVBFE_TUNER_FREQUENCY, &t_state); |
| 31 | if (err < 0) { | ||
| 35 | printk("%s: Invalid parameter\n", __func__); | 32 | printk("%s: Invalid parameter\n", __func__); |
| 36 | return err; | 33 | return err; |
| 37 | } | 34 | } |
| @@ -42,18 +39,16 @@ static int stb6100_get_frequency(struct dvb_frontend *fe, u32 *frequency) | |||
| 42 | 39 | ||
| 43 | static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency) | 40 | static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency) |
| 44 | { | 41 | { |
| 45 | struct dvb_frontend_ops *frontend_ops = NULL; | 42 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
| 46 | struct dvb_tuner_ops *tuner_ops = NULL; | 43 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
| 47 | struct tuner_state t_state; | 44 | struct tuner_state t_state; |
| 48 | int err = 0; | 45 | int err = 0; |
| 49 | 46 | ||
| 50 | t_state.frequency = frequency; | 47 | t_state.frequency = frequency; |
| 51 | if (&fe->ops) | 48 | |
| 52 | frontend_ops = &fe->ops; | ||
| 53 | if (&frontend_ops->tuner_ops) | ||
| 54 | tuner_ops = &frontend_ops->tuner_ops; | ||
| 55 | if (tuner_ops->set_state) { | 49 | if (tuner_ops->set_state) { |
| 56 | if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state)) < 0) { | 50 | err = tuner_ops->set_state(fe, DVBFE_TUNER_FREQUENCY, &t_state); |
| 51 | if (err < 0) { | ||
| 57 | printk("%s: Invalid parameter\n", __func__); | 52 | printk("%s: Invalid parameter\n", __func__); |
| 58 | return err; | 53 | return err; |
| 59 | } | 54 | } |
| @@ -68,12 +63,9 @@ static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) | |||
| 68 | struct tuner_state t_state; | 63 | struct tuner_state t_state; |
| 69 | int err = 0; | 64 | int err = 0; |
| 70 | 65 | ||
| 71 | if (&fe->ops) | ||
| 72 | frontend_ops = &fe->ops; | ||
| 73 | if (&frontend_ops->tuner_ops) | ||
| 74 | tuner_ops = &frontend_ops->tuner_ops; | ||
| 75 | if (tuner_ops->get_state) { | 66 | if (tuner_ops->get_state) { |
| 76 | if ((err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) { | 67 | err = tuner_ops->get_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state); |
| 68 | if (err < 0) { | ||
| 77 | printk("%s: Invalid parameter\n", __func__); | 69 | printk("%s: Invalid parameter\n", __func__); |
| 78 | return err; | 70 | return err; |
| 79 | } | 71 | } |
| @@ -84,18 +76,16 @@ static int stb6100_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth) | |||
| 84 | 76 | ||
| 85 | static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) | 77 | static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth) |
| 86 | { | 78 | { |
| 87 | struct dvb_frontend_ops *frontend_ops = NULL; | 79 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
| 88 | struct dvb_tuner_ops *tuner_ops = NULL; | 80 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
| 89 | struct tuner_state t_state; | 81 | struct tuner_state t_state; |
| 90 | int err = 0; | 82 | int err = 0; |
| 91 | 83 | ||
| 92 | t_state.bandwidth = bandwidth; | 84 | t_state.bandwidth = bandwidth; |
| 93 | if (&fe->ops) | 85 | |
| 94 | frontend_ops = &fe->ops; | ||
| 95 | if (&frontend_ops->tuner_ops) | ||
| 96 | tuner_ops = &frontend_ops->tuner_ops; | ||
| 97 | if (tuner_ops->set_state) { | 86 | if (tuner_ops->set_state) { |
| 98 | if ((err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state)) < 0) { | 87 | err = tuner_ops->set_state(fe, DVBFE_TUNER_BANDWIDTH, &t_state); |
| 88 | if (err < 0) { | ||
| 99 | printk("%s: Invalid parameter\n", __func__); | 89 | printk("%s: Invalid parameter\n", __func__); |
| 100 | return err; | 90 | return err; |
| 101 | } | 91 | } |
