aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners/r820t.c
diff options
context:
space:
mode:
authorGianluca Gennari <gennarone@gmail.com>2013-06-02 13:30:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-19 10:07:18 -0400
commite2e324d70defce7ffc4668085dc3c8ae580074e5 (patch)
tree006d720273127a08df712a25534441176af87122 /drivers/media/tuners/r820t.c
parentc2efd3e6e04942aa8206ca26c855eabf67cfdbc0 (diff)
[media] r820t: remove redundant initializations in r820t_attach()
fe->tuner_priv and fe->ops.tuner_ops are initialized twice in r820t_attach(). Remove the redundant initializations and also move fe->ops.tuner_ops initialization outside of the mutex lock (as in the xc4000 tuner code for example). Signed-off-by: Gianluca Gennari <gennarone@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/tuners/r820t.c')
-rw-r--r--drivers/media/tuners/r820t.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index 64f97389d5b0..63062a9b4003 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -2310,8 +2310,6 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
2310 break; 2310 break;
2311 } 2311 }
2312 2312
2313 memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, sizeof(r820t_tuner_ops));
2314
2315 if (fe->ops.i2c_gate_ctrl) 2313 if (fe->ops.i2c_gate_ctrl)
2316 fe->ops.i2c_gate_ctrl(fe, 1); 2314 fe->ops.i2c_gate_ctrl(fe, 1);
2317 2315
@@ -2326,15 +2324,14 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
2326 2324
2327 tuner_info("Rafael Micro r820t successfully identified\n"); 2325 tuner_info("Rafael Micro r820t successfully identified\n");
2328 2326
2329 fe->tuner_priv = priv;
2330 memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops,
2331 sizeof(struct dvb_tuner_ops));
2332
2333 if (fe->ops.i2c_gate_ctrl) 2327 if (fe->ops.i2c_gate_ctrl)
2334 fe->ops.i2c_gate_ctrl(fe, 0); 2328 fe->ops.i2c_gate_ctrl(fe, 0);
2335 2329
2336 mutex_unlock(&r820t_list_mutex); 2330 mutex_unlock(&r820t_list_mutex);
2337 2331
2332 memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops,
2333 sizeof(struct dvb_tuner_ops));
2334
2338 return fe; 2335 return fe;
2339err: 2336err:
2340 if (fe->ops.i2c_gate_ctrl) 2337 if (fe->ops.i2c_gate_ctrl)