aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-12-21 09:18:32 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:11 -0500
commitbc3e5c7fc20d3c09667067878fb7a55dd9fc041d (patch)
tree81d83ec2aa0b21f8b594d45a398bdefe206ad3e3 /drivers/media/video
parent9ad89f0104314786138d580ab2c1119e7e470f56 (diff)
V4L/DVB (6881): include struct analog_demod_ops directly inside struct dvb_frontend
Rather than using a pointer, include struct analog_demod_ops directly inside struct dvb_frontend. This will allow us to use dvb_attach in the future, along with removing the need to check the ops structure before having to check the pointer to the method being called. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tda8290.c23
-rw-r--r--drivers/media/video/tda9887.c5
-rw-r--r--drivers/media/video/tuner-core.c99
3 files changed, 62 insertions, 65 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 71d38ba37f2e..2e1d9b663a91 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -512,16 +512,16 @@ static void tda829x_release(struct dvb_frontend *fe)
512static int tda829x_find_tuner(struct dvb_frontend *fe) 512static int tda829x_find_tuner(struct dvb_frontend *fe)
513{ 513{
514 struct tda8290_priv *priv = fe->analog_demod_priv; 514 struct tda8290_priv *priv = fe->analog_demod_priv;
515 struct analog_tuner_ops *ops = fe->ops.analog_demod_ops; 515 struct analog_demod_ops *analog_ops = &fe->ops.analog_ops;
516 int i, ret, tuners_found; 516 int i, ret, tuners_found;
517 u32 tuner_addrs; 517 u32 tuner_addrs;
518 u8 data; 518 u8 data;
519 struct i2c_msg msg = { .flags = I2C_M_RD, .buf = &data, .len = 1 }; 519 struct i2c_msg msg = { .flags = I2C_M_RD, .buf = &data, .len = 1 };
520 520
521 if (NULL == ops) 521 if (NULL == analog_ops->i2c_gate_ctrl)
522 return -EINVAL; 522 return -EINVAL;
523 523
524 ops->i2c_gate_ctrl(fe, 1); 524 analog_ops->i2c_gate_ctrl(fe, 1);
525 525
526 /* probe for tuner chip */ 526 /* probe for tuner chip */
527 tuners_found = 0; 527 tuners_found = 0;
@@ -539,7 +539,7 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
539 give a response now 539 give a response now
540 */ 540 */
541 541
542 ops->i2c_gate_ctrl(fe, 0); 542 analog_ops->i2c_gate_ctrl(fe, 0);
543 543
544 if (tuners_found > 1) 544 if (tuners_found > 1)
545 for (i = 0; i < tuners_found; i++) { 545 for (i = 0; i < tuners_found; i++) {
@@ -562,7 +562,7 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
562 priv->tda827x_addr = tuner_addrs; 562 priv->tda827x_addr = tuner_addrs;
563 msg.addr = tuner_addrs; 563 msg.addr = tuner_addrs;
564 564
565 ops->i2c_gate_ctrl(fe, 1); 565 analog_ops->i2c_gate_ctrl(fe, 1);
566 ret = i2c_transfer(priv->i2c_props.adap, &msg, 1); 566 ret = i2c_transfer(priv->i2c_props.adap, &msg, 1);
567 567
568 if (ret != 1) { 568 if (ret != 1) {
@@ -590,7 +590,7 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
590 if (fe->ops.tuner_ops.sleep) 590 if (fe->ops.tuner_ops.sleep)
591 fe->ops.tuner_ops.sleep(fe); 591 fe->ops.tuner_ops.sleep(fe);
592 592
593 ops->i2c_gate_ctrl(fe, 0); 593 analog_ops->i2c_gate_ctrl(fe, 0);
594 594
595 return 0; 595 return 0;
596} 596}
@@ -635,7 +635,7 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
635 return -ENODEV; 635 return -ENODEV;
636} 636}
637 637
638static struct analog_tuner_ops tda8290_tuner_ops = { 638static struct analog_demod_ops tda8290_ops = {
639 .info = { 639 .info = {
640 .name = "TDA8290", 640 .name = "TDA8290",
641 }, 641 },
@@ -646,7 +646,7 @@ static struct analog_tuner_ops tda8290_tuner_ops = {
646 .i2c_gate_ctrl = tda8290_i2c_bridge, 646 .i2c_gate_ctrl = tda8290_i2c_bridge,
647}; 647};
648 648
649static struct analog_tuner_ops tda8295_tuner_ops = { 649static struct analog_demod_ops tda8295_ops = {
650 .info = { 650 .info = {
651 .name = "TDA8295", 651 .name = "TDA8295",
652 }, 652 },
@@ -678,12 +678,14 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
678 678
679 if (tda8290_probe(&priv->i2c_props) == 0) { 679 if (tda8290_probe(&priv->i2c_props) == 0) {
680 priv->ver = TDA8290; 680 priv->ver = TDA8290;
681 fe->ops.analog_demod_ops = &tda8290_tuner_ops; 681 memcpy(&fe->ops.analog_ops, &tda8290_ops,
682 sizeof(struct analog_demod_ops));
682 } 683 }
683 684
684 if (tda8295_probe(&priv->i2c_props) == 0) { 685 if (tda8295_probe(&priv->i2c_props) == 0) {
685 priv->ver = TDA8295; 686 priv->ver = TDA8295;
686 fe->ops.analog_demod_ops = &tda8295_tuner_ops; 687 memcpy(&fe->ops.analog_ops, &tda8295_ops,
688 sizeof(struct analog_demod_ops));
687 } 689 }
688 690
689 if (tda829x_find_tuner(fe) < 0) 691 if (tda829x_find_tuner(fe) < 0)
@@ -723,7 +725,6 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
723 725
724fail: 726fail:
725 tda829x_release(fe); 727 tda829x_release(fe);
726 fe->ops.analog_demod_ops = NULL;
727 return NULL; 728 return NULL;
728} 729}
729EXPORT_SYMBOL_GPL(tda829x_attach); 730EXPORT_SYMBOL_GPL(tda829x_attach);
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index 1b017d52bfb5..d3aabe2d146b 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -648,7 +648,7 @@ static void tda9887_release(struct dvb_frontend *fe)
648 fe->analog_demod_priv = NULL; 648 fe->analog_demod_priv = NULL;
649} 649}
650 650
651static struct analog_tuner_ops tda9887_tuner_ops = { 651static struct analog_demod_ops tda9887_ops = {
652 .info = { 652 .info = {
653 .name = "TDA9887", 653 .name = "TDA9887",
654 }, 654 },
@@ -677,7 +677,8 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe,
677 677
678 tuner_info("tda988[5/6/7] found\n"); 678 tuner_info("tda988[5/6/7] found\n");
679 679
680 fe->ops.analog_demod_ops = &tda9887_tuner_ops; 680 memcpy(&fe->ops.analog_ops, &tda9887_ops,
681 sizeof(struct analog_demod_ops));
681 682
682 return fe; 683 return fe;
683} 684}
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index ad20af84809d..f792871582ff 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -143,8 +143,6 @@ static void fe_release(struct dvb_frontend *fe)
143 if (fe->ops.tuner_ops.release) 143 if (fe->ops.tuner_ops.release)
144 fe->ops.tuner_ops.release(fe); 144 fe->ops.tuner_ops.release(fe);
145 145
146 fe->ops.analog_demod_ops = NULL;
147
148 /* DO NOT kfree(fe->analog_demod_priv) 146 /* DO NOT kfree(fe->analog_demod_priv)
149 * 147 *
150 * If we are in this function, analog_demod_priv contains a pointer 148 * If we are in this function, analog_demod_priv contains a pointer
@@ -189,7 +187,7 @@ static int fe_set_config(struct dvb_frontend *fe, void *priv_cfg)
189 187
190static void tuner_status(struct dvb_frontend *fe); 188static void tuner_status(struct dvb_frontend *fe);
191 189
192static struct analog_tuner_ops tuner_core_ops = { 190static struct analog_demod_ops tuner_core_ops = {
193 .set_params = fe_set_params, 191 .set_params = fe_set_params,
194 .standby = fe_standby, 192 .standby = fe_standby,
195 .release = fe_release, 193 .release = fe_release,
@@ -202,7 +200,7 @@ static struct analog_tuner_ops tuner_core_ops = {
202static void set_tv_freq(struct i2c_client *c, unsigned int freq) 200static void set_tv_freq(struct i2c_client *c, unsigned int freq)
203{ 201{
204 struct tuner *t = i2c_get_clientdata(c); 202 struct tuner *t = i2c_get_clientdata(c);
205 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 203 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
206 204
207 struct analog_parameters params = { 205 struct analog_parameters params = {
208 .mode = t->mode, 206 .mode = t->mode,
@@ -214,7 +212,7 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq)
214 tuner_warn ("tuner type not set\n"); 212 tuner_warn ("tuner type not set\n");
215 return; 213 return;
216 } 214 }
217 if ((NULL == ops) || (NULL == ops->set_params)) { 215 if (NULL == analog_ops->set_params) {
218 tuner_warn ("Tuner has no way to set tv freq\n"); 216 tuner_warn ("Tuner has no way to set tv freq\n");
219 return; 217 return;
220 } 218 }
@@ -231,13 +229,13 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq)
231 } 229 }
232 params.frequency = freq; 230 params.frequency = freq;
233 231
234 ops->set_params(&t->fe, &params); 232 analog_ops->set_params(&t->fe, &params);
235} 233}
236 234
237static void set_radio_freq(struct i2c_client *c, unsigned int freq) 235static void set_radio_freq(struct i2c_client *c, unsigned int freq)
238{ 236{
239 struct tuner *t = i2c_get_clientdata(c); 237 struct tuner *t = i2c_get_clientdata(c);
240 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 238 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
241 239
242 struct analog_parameters params = { 240 struct analog_parameters params = {
243 .mode = t->mode, 241 .mode = t->mode,
@@ -249,7 +247,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq)
249 tuner_warn ("tuner type not set\n"); 247 tuner_warn ("tuner type not set\n");
250 return; 248 return;
251 } 249 }
252 if ((NULL == ops) || (NULL == ops->set_params)) { 250 if (analog_ops->set_params) {
253 tuner_warn ("tuner has no way to set radio frequency\n"); 251 tuner_warn ("tuner has no way to set radio frequency\n");
254 return; 252 return;
255 } 253 }
@@ -266,7 +264,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq)
266 } 264 }
267 params.frequency = freq; 265 params.frequency = freq;
268 266
269 ops->set_params(&t->fe, &params); 267 analog_ops->set_params(&t->fe, &params);
270} 268}
271 269
272static void set_freq(struct i2c_client *c, unsigned long freq) 270static void set_freq(struct i2c_client *c, unsigned long freq)
@@ -337,7 +335,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
337{ 335{
338 struct tuner *t = i2c_get_clientdata(c); 336 struct tuner *t = i2c_get_clientdata(c);
339 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; 337 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
340 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 338 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
341 unsigned char buffer[4]; 339 unsigned char buffer[4];
342 340
343 if (type == UNSET || type == TUNER_ABSENT) { 341 if (type == UNSET || type == TUNER_ABSENT) {
@@ -364,8 +362,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
364 } 362 }
365 363
366 /* discard private data, in case set_type() was previously called */ 364 /* discard private data, in case set_type() was previously called */
367 if (ops && ops->release) 365 if (analog_ops->release)
368 ops->release(&t->fe); 366 analog_ops->release(&t->fe);
369 367
370 switch (t->type) { 368 switch (t->type) {
371 case TUNER_MT2032: 369 case TUNER_MT2032:
@@ -435,17 +433,16 @@ static void set_type(struct i2c_client *c, unsigned int type,
435 break; 433 break;
436 } 434 }
437 435
438 ops = t->fe.ops.analog_demod_ops; 436 if ((NULL == analog_ops->set_params) &&
439
440 if (((NULL == ops) || (NULL == ops->set_params)) &&
441 (fe_tuner_ops->set_analog_params)) { 437 (fe_tuner_ops->set_analog_params)) {
442 strlcpy(t->i2c->name, fe_tuner_ops->info.name, 438 strlcpy(t->i2c->name, fe_tuner_ops->info.name,
443 sizeof(t->i2c->name)); 439 sizeof(t->i2c->name));
444 440
445 t->fe.ops.analog_demod_ops = &tuner_core_ops;
446 t->fe.analog_demod_priv = t; 441 t->fe.analog_demod_priv = t;
442 memcpy(analog_ops, &tuner_core_ops,
443 sizeof(struct analog_demod_ops));
447 } else { 444 } else {
448 strlcpy(t->i2c->name, ops->info.name, 445 strlcpy(t->i2c->name, analog_ops->info.name,
449 sizeof(t->i2c->name)); 446 sizeof(t->i2c->name));
450 } 447 }
451 448
@@ -624,7 +621,7 @@ static void tuner_status(struct dvb_frontend *fe)
624 struct tuner *t = fe->analog_demod_priv; 621 struct tuner *t = fe->analog_demod_priv;
625 unsigned long freq, freq_fraction; 622 unsigned long freq, freq_fraction;
626 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; 623 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
627 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 624 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
628 const char *p; 625 const char *p;
629 626
630 switch (t->mode) { 627 switch (t->mode) {
@@ -654,14 +651,12 @@ static void tuner_status(struct dvb_frontend *fe)
654 if (tuner_status & TUNER_STATUS_STEREO) 651 if (tuner_status & TUNER_STATUS_STEREO)
655 tuner_info("Stereo: yes\n"); 652 tuner_info("Stereo: yes\n");
656 } 653 }
657 if (ops) { 654 if (analog_ops->has_signal)
658 if (ops->has_signal) 655 tuner_info("Signal strength: %d\n",
659 tuner_info("Signal strength: %d\n", 656 analog_ops->has_signal(fe));
660 ops->has_signal(fe)); 657 if (analog_ops->is_stereo)
661 if (ops->is_stereo) 658 tuner_info("Stereo: %s\n",
662 tuner_info("Stereo: %s\n", 659 analog_ops->is_stereo(fe) ? "yes" : "no");
663 ops->is_stereo(fe) ? "yes" : "no");
664 }
665} 660}
666 661
667/* ---------------------------------------------------------------------- */ 662/* ---------------------------------------------------------------------- */
@@ -675,7 +670,7 @@ static void tuner_status(struct dvb_frontend *fe)
675 670
676static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd) 671static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode, char *cmd)
677{ 672{
678 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 673 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
679 674
680 if (mode == t->mode) 675 if (mode == t->mode)
681 return 0; 676 return 0;
@@ -684,8 +679,8 @@ static inline int set_mode(struct i2c_client *client, struct tuner *t, int mode,
684 679
685 if (check_mode(t, cmd) == EINVAL) { 680 if (check_mode(t, cmd) == EINVAL) {
686 t->mode = T_STANDBY; 681 t->mode = T_STANDBY;
687 if (ops && ops->standby) 682 if (analog_ops->standby)
688 ops->standby(&t->fe); 683 analog_ops->standby(&t->fe);
689 return EINVAL; 684 return EINVAL;
690 } 685 }
691 return 0; 686 return 0;
@@ -708,7 +703,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
708{ 703{
709 struct tuner *t = i2c_get_clientdata(client); 704 struct tuner *t = i2c_get_clientdata(client);
710 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; 705 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
711 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 706 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
712 707
713 if (tuner_debug>1) 708 if (tuner_debug>1)
714 v4l_i2c_print_ioctl(client,cmd); 709 v4l_i2c_print_ioctl(client,cmd);
@@ -735,8 +730,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
735 if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL) 730 if (check_mode(t, "TUNER_SET_STANDBY") == EINVAL)
736 return 0; 731 return 0;
737 t->mode = T_STANDBY; 732 t->mode = T_STANDBY;
738 if (ops && ops->standby) 733 if (analog_ops->standby)
739 ops->standby(&t->fe); 734 analog_ops->standby(&t->fe);
740 break; 735 break;
741#ifdef CONFIG_VIDEO_V4L1 736#ifdef CONFIG_VIDEO_V4L1
742 case VIDIOCSAUDIO: 737 case VIDIOCSAUDIO:
@@ -804,8 +799,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
804 else 799 else
805 vt->flags &= ~VIDEO_TUNER_STEREO_ON; 800 vt->flags &= ~VIDEO_TUNER_STEREO_ON;
806 } else { 801 } else {
807 if (ops && ops->is_stereo) { 802 if (analog_ops->is_stereo) {
808 if (ops->is_stereo(&t->fe)) 803 if (analog_ops->is_stereo(&t->fe))
809 vt->flags |= 804 vt->flags |=
810 VIDEO_TUNER_STEREO_ON; 805 VIDEO_TUNER_STEREO_ON;
811 else 806 else
@@ -813,8 +808,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
813 ~VIDEO_TUNER_STEREO_ON; 808 ~VIDEO_TUNER_STEREO_ON;
814 } 809 }
815 } 810 }
816 if (ops && ops->has_signal) 811 if (analog_ops->has_signal)
817 vt->signal = ops->has_signal(&t->fe); 812 vt->signal =
813 analog_ops->has_signal(&t->fe);
818 814
819 vt->flags |= VIDEO_TUNER_LOW; /* Allow freqs at 62.5 Hz */ 815 vt->flags |= VIDEO_TUNER_LOW; /* Allow freqs at 62.5 Hz */
820 816
@@ -844,8 +840,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
844 fe_tuner_ops->get_status(&t->fe, &tuner_status); 840 fe_tuner_ops->get_status(&t->fe, &tuner_status);
845 va->mode = (tuner_status & TUNER_STATUS_STEREO) 841 va->mode = (tuner_status & TUNER_STATUS_STEREO)
846 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; 842 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
847 } else if (ops && ops->is_stereo) 843 } else if (analog_ops->is_stereo)
848 va->mode = ops->is_stereo(&t->fe) 844 va->mode = analog_ops->is_stereo(&t->fe)
849 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO; 845 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
850 } 846 }
851 return 0; 847 return 0;
@@ -853,19 +849,18 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
853#endif 849#endif
854 case TUNER_SET_CONFIG: 850 case TUNER_SET_CONFIG:
855 { 851 {
856 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops;
857 struct v4l2_priv_tun_config *cfg = arg; 852 struct v4l2_priv_tun_config *cfg = arg;
858 853
859 if (t->type != cfg->tuner) 854 if (t->type != cfg->tuner)
860 break; 855 break;
861 856
862 if ((NULL == ops) || (NULL == ops->set_config)) { 857 if (analog_ops->set_config) {
863 tuner_warn("Tuner frontend module has no way to " 858 tuner_warn("Tuner frontend module has no way to "
864 "set config\n"); 859 "set config\n");
865 break; 860 break;
866 } 861 }
867 862
868 ops->set_config(&t->fe, cfg->priv); 863 analog_ops->set_config(&t->fe, cfg->priv);
869 break; 864 break;
870 } 865 }
871 /* --- v4l ioctls --- */ 866 /* --- v4l ioctls --- */
@@ -929,8 +924,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
929 switch_v4l2(); 924 switch_v4l2();
930 925
931 tuner->type = t->mode; 926 tuner->type = t->mode;
932 if (ops && ops->get_afc) 927 if (analog_ops->get_afc)
933 tuner->afc = ops->get_afc(&t->fe); 928 tuner->afc = analog_ops->get_afc(&t->fe);
934 if (t->mode == V4L2_TUNER_ANALOG_TV) 929 if (t->mode == V4L2_TUNER_ANALOG_TV)
935 tuner->capability |= V4L2_TUNER_CAP_NORM; 930 tuner->capability |= V4L2_TUNER_CAP_NORM;
936 if (t->mode != V4L2_TUNER_RADIO) { 931 if (t->mode != V4L2_TUNER_RADIO) {
@@ -951,15 +946,15 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
951 V4L2_TUNER_SUB_STEREO : 946 V4L2_TUNER_SUB_STEREO :
952 V4L2_TUNER_SUB_MONO; 947 V4L2_TUNER_SUB_MONO;
953 } else { 948 } else {
954 if (ops && ops->is_stereo) { 949 if (analog_ops->is_stereo) {
955 tuner->rxsubchans = 950 tuner->rxsubchans =
956 ops->is_stereo(&t->fe) ? 951 analog_ops->is_stereo(&t->fe) ?
957 V4L2_TUNER_SUB_STEREO : 952 V4L2_TUNER_SUB_STEREO :
958 V4L2_TUNER_SUB_MONO; 953 V4L2_TUNER_SUB_MONO;
959 } 954 }
960 } 955 }
961 if (ops && ops->has_signal) 956 if (analog_ops->has_signal)
962 tuner->signal = ops->has_signal(&t->fe); 957 tuner->signal = analog_ops->has_signal(&t->fe);
963 tuner->capability |= 958 tuner->capability |=
964 V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; 959 V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
965 tuner->audmode = t->audmode; 960 tuner->audmode = t->audmode;
@@ -984,8 +979,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
984 break; 979 break;
985 } 980 }
986 case VIDIOC_LOG_STATUS: 981 case VIDIOC_LOG_STATUS:
987 if (ops && ops->tuner_status) 982 if (analog_ops->tuner_status)
988 ops->tuner_status(&t->fe); 983 analog_ops->tuner_status(&t->fe);
989 break; 984 break;
990 } 985 }
991 986
@@ -1214,10 +1209,10 @@ static int tuner_legacy_probe(struct i2c_adapter *adap)
1214static int tuner_remove(struct i2c_client *client) 1209static int tuner_remove(struct i2c_client *client)
1215{ 1210{
1216 struct tuner *t = i2c_get_clientdata(client); 1211 struct tuner *t = i2c_get_clientdata(client);
1217 struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops; 1212 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1218 1213
1219 if (ops && ops->release) 1214 if (analog_ops->release)
1220 ops->release(&t->fe); 1215 analog_ops->release(&t->fe);
1221 1216
1222 list_del(&t->list); 1217 list_del(&t->list);
1223 kfree(t); 1218 kfree(t);