aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-01-09 12:25:23 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 12:25:23 -0500
commit6a5bdd322e5366730803beb59adca7ebb144d7e4 (patch)
tree4052a855b927b65018a800424ba89dd7cbcfb73d
parent4302c15ea237a649780894e263125fcd8c548998 (diff)
V4L/DVB (3173): [PATCH] Decrease number of pointer derefs in flexcop-fe-tuner.c
- Here's a small patch to decrease the number of pointer derefs in drivers/media/dvb/b2c2/flexcop-fe-tuner.c Benefits of the patch: - Fewer pointer dereferences should make the code slightly faster. - Size of generated code is smaller - Improved readability Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index 21a9045b3ef6..fa7058108bf4 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -485,12 +485,16 @@ static struct stv0297_config alps_tdee4_stv0297_config = {
485/* try to figure out the frontend, each card/box can have on of the following list */ 485/* try to figure out the frontend, each card/box can have on of the following list */
486int flexcop_frontend_init(struct flexcop_device *fc) 486int flexcop_frontend_init(struct flexcop_device *fc)
487{ 487{
488 struct dvb_frontend_ops *ops;
489
488 /* try the sky v2.6 (stv0299/Samsung tbmu24112(sl1935)) */ 490 /* try the sky v2.6 (stv0299/Samsung tbmu24112(sl1935)) */
489 if ((fc->fe = stv0299_attach(&samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) { 491 if ((fc->fe = stv0299_attach(&samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) {
490 fc->fe->ops->set_voltage = flexcop_set_voltage; 492 ops = fc->fe->ops;
493
494 ops->set_voltage = flexcop_set_voltage;
491 495
492 fc->fe_sleep = fc->fe->ops->sleep; 496 fc->fe_sleep = ops->sleep;
493 fc->fe->ops->sleep = flexcop_sleep; 497 ops->sleep = flexcop_sleep;
494 498
495 fc->dev_type = FC_SKY; 499 fc->dev_type = FC_SKY;
496 info("found the stv0299 at i2c address: 0x%02x",samsung_tbmu24112_config.demod_address); 500 info("found the stv0299 at i2c address: 0x%02x",samsung_tbmu24112_config.demod_address);
@@ -522,15 +526,17 @@ int flexcop_frontend_init(struct flexcop_device *fc)
522 } else 526 } else
523 /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ 527 /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
524 if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { 528 if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) {
525 fc->fe->ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; 529 ops = fc->fe->ops;
526 fc->fe->ops->diseqc_send_burst = flexcop_diseqc_send_burst; 530
527 fc->fe->ops->set_tone = flexcop_set_tone; 531 ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd;
528 fc->fe->ops->set_voltage = flexcop_set_voltage; 532 ops->diseqc_send_burst = flexcop_diseqc_send_burst;
533 ops->set_tone = flexcop_set_tone;
534 ops->set_voltage = flexcop_set_voltage;
529 535
530 fc->fe_sleep = fc->fe->ops->sleep; 536 fc->fe_sleep = ops->sleep;
531 fc->fe->ops->sleep = flexcop_sleep; 537 ops->sleep = flexcop_sleep;
532 538
533 fc->dev_type = FC_SKY_OLD; 539 fc->dev_type = FC_SKY_OLD;
534 info("found the vp310 (aka mt312) at i2c address: 0x%02x",skystar23_samsung_tbdu18132_config.demod_address); 540 info("found the vp310 (aka mt312) at i2c address: 0x%02x",skystar23_samsung_tbdu18132_config.demod_address);
535 } 541 }
536 542
@@ -540,8 +546,9 @@ int flexcop_frontend_init(struct flexcop_device *fc)
540 } else { 546 } else {
541 if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) { 547 if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) {
542 err("frontend registration failed!"); 548 err("frontend registration failed!");
543 if (fc->fe->ops->release != NULL) 549 ops = fc->fe->ops;
544 fc->fe->ops->release(fc->fe); 550 if (ops->release != NULL)
551 ops->release(fc->fe);
545 fc->fe = NULL; 552 fc->fe = NULL;
546 return -EINVAL; 553 return -EINVAL;
547 } 554 }