summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-07-18 16:37:13 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-07-29 17:22:26 -0300
commit95faba22d8b81f0cd85b995232b7d05c45a26f3e (patch)
tree1ce43205118a7bcebbcfc063a5b173c8fe398729 /drivers/media
parent55c05b6d226f68266d1f88dd81795b04d096b1c8 (diff)
V4L/DVB (4322): Fix dvb-pll autoprobing
Trent Piepho pointed out that the pll test i2c transmission is slightly wrong; it was transmitting a zero length message, and then reading from the PLL. This was wrong; it should only be transmitting a single read i2c message. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 4c8a506479b4..2be33f27c69f 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -614,8 +614,7 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
{
u8 b1 [] = { 0 };
- struct i2c_msg msg [] = { { .addr = pll_addr, .flags = 0, .buf = NULL, .len = 0 },
- { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
+ struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 };
struct dvb_pll_priv *priv = NULL;
int ret;
@@ -623,8 +622,8 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- ret = i2c_transfer (i2c, msg, 2);
- if (ret != 2)
+ ret = i2c_transfer (i2c, &msg, 1);
+ if (ret != 1)
return -1;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);