aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index fce5c4252252..4c8a506479b4 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -619,14 +619,16 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2
619 struct dvb_pll_priv *priv = NULL; 619 struct dvb_pll_priv *priv = NULL;
620 int ret; 620 int ret;
621 621
622 if (fe->ops.i2c_gate_ctrl) 622 if (i2c != NULL) {
623 fe->ops.i2c_gate_ctrl(fe, 1); 623 if (fe->ops.i2c_gate_ctrl)
624 624 fe->ops.i2c_gate_ctrl(fe, 1);
625 ret = i2c_transfer (i2c, msg, 2); 625
626 if (ret != 2) 626 ret = i2c_transfer (i2c, msg, 2);
627 return -1; 627 if (ret != 2)
628 if (fe->ops.i2c_gate_ctrl) 628 return -1;
629 fe->ops.i2c_gate_ctrl(fe, 0); 629 if (fe->ops.i2c_gate_ctrl)
630 fe->ops.i2c_gate_ctrl(fe, 0);
631 }
630 632
631 priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL); 633 priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
632 if (priv == NULL) 634 if (priv == NULL)