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 d6447791d0e5..c2c450fbf683 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c | |||
@@ -141,24 +141,21 @@ bt819_write_block (struct i2c_client *client, | |||
141 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 141 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
142 | /* do raw I2C, not smbus compatible */ | 142 | /* do raw I2C, not smbus compatible */ |
143 | struct bt819 *decoder = i2c_get_clientdata(client); | 143 | struct bt819 *decoder = i2c_get_clientdata(client); |
144 | struct i2c_msg msg; | ||
145 | u8 block_data[32]; | 144 | u8 block_data[32]; |
145 | int block_len; | ||
146 | 146 | ||
147 | msg.addr = client->addr; | ||
148 | msg.flags = 0; | ||
149 | while (len >= 2) { | 147 | while (len >= 2) { |
150 | msg.buf = (char *) block_data; | 148 | block_len = 0; |
151 | msg.len = 0; | 149 | block_data[block_len++] = reg = data[0]; |
152 | block_data[msg.len++] = reg = data[0]; | ||
153 | do { | 150 | do { |
154 | block_data[msg.len++] = | 151 | block_data[block_len++] = |
155 | decoder->reg[reg++] = data[1]; | 152 | decoder->reg[reg++] = data[1]; |
156 | len -= 2; | 153 | len -= 2; |
157 | data += 2; | 154 | data += 2; |
158 | } while (len >= 2 && data[0] == reg && | 155 | } while (len >= 2 && data[0] == reg && |
159 | msg.len < 32); | 156 | block_len < 32); |
160 | if ((ret = i2c_transfer(client->adapter, | 157 | if ((ret = i2c_master_send(client, block_data, |
161 | &msg, 1)) < 0) | 158 | block_len)) < 0) |
162 | break; | 159 | break; |
163 | } | 160 | } |
164 | } else { | 161 | } else { |