aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-02-14 22:55:18 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:32:02 -0400
commita34ec5f3743950cadb8f512c884b8c9dbaa9a7a5 (patch)
treef51bffb376a6b946aaee565593cdd49df123645b /drivers/media/video
parent900f734b3bafb4e111b9ec5d865c448a9911b2ab (diff)
[media] tuner-core: dead code removal
Remove the now obsolete set_freq. Also merge set_addr and set_type_addr. In the past, it used to have two different setup calls, one to set just the tuner type to any tuner found, and another to set the type only if the address matches. Those two internal calls were grouped together, but the functions weren't merged, making the code uglier. No functional changes are done in this patch. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tuner-core.c47
1 files changed, 10 insertions, 37 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 16939cad987c..2a0bea145a78 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -419,10 +419,17 @@ attach_failed:
419 * it's applied. Otherwise status and type are applied only to 419 * it's applied. Otherwise status and type are applied only to
420 * tuner with exactly the same addr. 420 * tuner with exactly the same addr.
421*/ 421*/
422 422static int tuner_s_type_addr(struct v4l2_subdev *sd,
423static void set_addr(struct i2c_client *c, struct tuner_setup *tun_setup) 423 struct tuner_setup *tun_setup)
424{ 424{
425 struct tuner *t = to_tuner(i2c_get_clientdata(c)); 425 struct tuner *t = to_tuner(sd);
426 struct i2c_client *c = v4l2_get_subdevdata(sd);
427
428 tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=0x%02x\n",
429 tun_setup->type,
430 tun_setup->addr,
431 tun_setup->mode_mask,
432 tun_setup->config);
426 433
427 if ((t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) && 434 if ((t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) &&
428 (t->mode_mask & tun_setup->mode_mask))) || 435 (t->mode_mask & tun_setup->mode_mask))) ||
@@ -434,20 +441,7 @@ static void set_addr(struct i2c_client *c, struct tuner_setup *tun_setup)
434 "Asked to change tuner at addr 0x%02x, with mask %x\n", 441 "Asked to change tuner at addr 0x%02x, with mask %x\n",
435 t->type, t->mode_mask, 442 t->type, t->mode_mask,
436 tun_setup->addr, tun_setup->mode_mask); 443 tun_setup->addr, tun_setup->mode_mask);
437}
438
439static int tuner_s_type_addr(struct v4l2_subdev *sd, struct tuner_setup *type)
440{
441 struct tuner *t = to_tuner(sd);
442 struct i2c_client *client = v4l2_get_subdevdata(sd);
443 444
444 tuner_dbg("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x, config=0x%02x\n",
445 type->type,
446 type->addr,
447 type->mode_mask,
448 type->config);
449
450 set_addr(client, type);
451 return 0; 445 return 0;
452} 446}
453 447
@@ -900,27 +894,6 @@ static int set_mode_freq(struct i2c_client *client, struct tuner *t,
900 return 0; 894 return 0;
901} 895}
902 896
903/*
904 * Functions that should be broken into separate radio/TV functions
905 */
906
907static void set_freq(struct i2c_client *c, unsigned long freq)
908{
909 struct tuner *t = to_tuner(i2c_get_clientdata(c));
910
911 switch (t->mode) {
912 case V4L2_TUNER_RADIO:
913 set_radio_freq(c, freq);
914 break;
915 case V4L2_TUNER_ANALOG_TV:
916 case V4L2_TUNER_DIGITAL_TV:
917 set_tv_freq(c, freq);
918 break;
919 default:
920 tuner_dbg("freq set: unknown mode: 0x%04x!\n", t->mode);
921 }
922}
923
924/** 897/**
925 * tuner_status - Dumps the current tuner status at dmesg 898 * tuner_status - Dumps the current tuner status at dmesg
926 * @fe: pointer to struct dvb_frontend 899 * @fe: pointer to struct dvb_frontend