1 From e2e324d70defce7ffc4668085dc3c8ae580074e5 Mon Sep 17 00:00:00 2001
2 From: Gianluca Gennari <gennarone@gmail.com>
3 Date: Sun, 2 Jun 2013 14:30:09 -0300
4 Subject: [PATCH 2/3] [media] r820t: remove redundant initializations in
7 fe->tuner_priv and fe->ops.tuner_ops are initialized twice in r820t_attach().
8 Remove the redundant initializations and also move fe->ops.tuner_ops
9 initialization outside of the mutex lock (as in the xc4000 tuner code for example).
11 Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
12 Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
13 Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 drivers/media/tuners/r820t.c | 9 +++------
16 1 file changed, 3 insertions(+), 6 deletions(-)
18 diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
19 index 64f9738..63062a9 100644
20 --- a/drivers/media/tuners/r820t.c
21 +++ b/drivers/media/tuners/r820t.c
22 @@ -2310,8 +2310,6 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
26 - memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, sizeof(r820t_tuner_ops));
28 if (fe->ops.i2c_gate_ctrl)
29 fe->ops.i2c_gate_ctrl(fe, 1);
31 @@ -2326,15 +2324,14 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
33 tuner_info("Rafael Micro r820t successfully identified\n");
35 - fe->tuner_priv = priv;
36 - memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops,
37 - sizeof(struct dvb_tuner_ops));
39 if (fe->ops.i2c_gate_ctrl)
40 fe->ops.i2c_gate_ctrl(fe, 0);
42 mutex_unlock(&r820t_list_mutex);
44 + memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops,
45 + sizeof(struct dvb_tuner_ops));
49 if (fe->ops.i2c_gate_ctrl)