From bfd3ccda0fe03c4378b88c22156ed6d20f365805 Mon Sep 17 00:00:00 2001 From: Patrick Boettcher Date: Mon, 30 Nov 2009 14:14:36 -0300 Subject: [PATCH] --- yaml --- r: 176806 b: refs/heads/master c: 38ffcd10d6831efd15ec5a223b1050eac12d4c28 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/dvb/dvb-usb/dibusb-common.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 1ef7000cebe4..aab60a73278d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d995a18733a683c1c086a4d48315976f8c25d89b +refs/heads/master: 38ffcd10d6831efd15ec5a223b1050eac12d4c28 diff --git a/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c b/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c index b395e852e47f..9143b5631e88 100644 --- a/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/trunk/drivers/media/dvb/dvb-usb/dibusb-common.c @@ -142,8 +142,13 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num } else if ((msg[i].flags & I2C_M_RD) == 0) { if (dibusb_i2c_msg(d, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0) break; - } else - break; + } else if (msg[i].addr != 0x50) { + /* 0x50 is the address of the eeprom - we need to protect it + * from dibusb's bad i2c implementation: reads without + * writing the offset before are forbidden */ + if (dibusb_i2c_msg(d, msg[i].addr, NULL, 0, msg[i].buf, msg[i].len) < 0) + break; + } } mutex_unlock(&d->i2c_mutex);