From: Gianluca Gennari Date: Sun, 2 Jun 2013 17:30:09 +0000 (-0300) Subject: [media] r820t: remove redundant initializations in r820t_attach() X-Git-Tag: firefly_0821_release~176^2~3573^2~1668 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e2e324d70defce7ffc4668085dc3c8ae580074e5;p=firefly-linux-kernel-4.4.55.git [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 Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- 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, break; } - memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, sizeof(r820t_tuner_ops)); - if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); @@ -2326,15 +2324,14 @@ struct dvb_frontend *r820t_attach(struct dvb_frontend *fe, tuner_info("Rafael Micro r820t successfully identified\n"); - fe->tuner_priv = priv; - memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, - sizeof(struct dvb_tuner_ops)); - if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); mutex_unlock(&r820t_list_mutex); + memcpy(&fe->ops.tuner_ops, &r820t_tuner_ops, + sizeof(struct dvb_tuner_ops)); + return fe; err: if (fe->ops.i2c_gate_ctrl)