diff options
Diffstat (limited to 'drivers/media/video/bt819.c')
-rw-r--r-- | drivers/media/video/bt819.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 2bf63e7ab4e6..d8a18a6a5bee 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c | |||
@@ -140,24 +140,21 @@ bt819_write_block (struct i2c_client *client, | |||
140 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 140 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
141 | /* do raw I2C, not smbus compatible */ | 141 | /* do raw I2C, not smbus compatible */ |
142 | struct bt819 *decoder = i2c_get_clientdata(client); | 142 | struct bt819 *decoder = i2c_get_clientdata(client); |
143 | struct i2c_msg msg; | ||
144 | u8 block_data[32]; | 143 | u8 block_data[32]; |
144 | int block_len; | ||
145 | 145 | ||
146 | msg.addr = client->addr; | ||
147 | msg.flags = 0; | ||
148 | while (len >= 2) { | 146 | while (len >= 2) { |
149 | msg.buf = (char *) block_data; | 147 | block_len = 0; |
150 | msg.len = 0; | 148 | block_data[block_len++] = reg = data[0]; |
151 | block_data[msg.len++] = reg = data[0]; | ||
152 | do { | 149 | do { |
153 | block_data[msg.len++] = | 150 | block_data[block_len++] = |
154 | decoder->reg[reg++] = data[1]; | 151 | decoder->reg[reg++] = data[1]; |
155 | len -= 2; | 152 | len -= 2; |
156 | data += 2; | 153 | data += 2; |
157 | } while (len >= 2 && data[0] == reg && | 154 | } while (len >= 2 && data[0] == reg && |
158 | msg.len < 32); | 155 | block_len < 32); |
159 | if ((ret = i2c_transfer(client->adapter, | 156 | if ((ret = i2c_master_send(client, block_data, |
160 | &msg, 1)) < 0) | 157 | block_len)) < 0) |
161 | break; | 158 | break; |
162 | } | 159 | } |
163 | } else { | 160 | } else { |