diff options
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index 08469ccabb72..8c954814f827 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -148,13 +148,18 @@ static int m9206_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
148 | return -EAGAIN; | 148 | return -EAGAIN; |
149 | 149 | ||
150 | for (i = 0; i < num; i++) { | 150 | for (i = 0; i < num; i++) { |
151 | if (msg[i].flags & (I2C_M_NO_RD_ACK|I2C_M_IGNORE_NAK|I2C_M_TEN)) { | 151 | if (msg[i].flags & (I2C_M_NO_RD_ACK|I2C_M_IGNORE_NAK|I2C_M_TEN) || |
152 | msg[i].len == 0) { | ||
153 | /* For a 0 byte message, I think sending the address to index 0x80|0x40 | ||
154 | * would be the correct thing to do. However, zero byte messages are | ||
155 | * only used for probing, and since we don't know how to get the slave's | ||
156 | * ack, we can't probe. */ | ||
152 | ret = -ENOTSUPP; | 157 | ret = -ENOTSUPP; |
153 | goto unlock; | 158 | goto unlock; |
154 | } | 159 | } |
155 | /* Send START & address/RW bit */ | 160 | /* Send START & address/RW bit */ |
156 | if (!(msg[i].flags & I2C_M_NOSTART)) { | 161 | if (!(msg[i].flags & I2C_M_NOSTART)) { |
157 | if ((ret = m9206_write(d->udev, M9206_I2C, (msg[i].addr<<1)|(msg[i].flags&I2C_M_RD?0x01:00), 0x80)) != 0) | 162 | if ((ret = m9206_write(d->udev, M9206_I2C, (msg[i].addr<<1)|(msg[i].flags&I2C_M_RD?0x01:0), 0x80)) != 0) |
158 | goto unlock; | 163 | goto unlock; |
159 | /* Should check for ack here, if we knew how. */ | 164 | /* Should check for ack here, if we knew how. */ |
160 | } | 165 | } |