diff options
Diffstat (limited to 'drivers/media/video/saa7114.c')
-rw-r--r-- | drivers/media/video/saa7114.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index 1c29d05307a5..849b54cd5c24 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c | |||
@@ -154,24 +154,21 @@ saa7114_write_block (struct i2c_client *client, | |||
154 | * the adapter understands raw I2C */ | 154 | * the adapter understands raw I2C */ |
155 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 155 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
156 | /* do raw I2C, not smbus compatible */ | 156 | /* do raw I2C, not smbus compatible */ |
157 | struct i2c_msg msg; | ||
158 | u8 block_data[32]; | 157 | u8 block_data[32]; |
158 | int block_len; | ||
159 | 159 | ||
160 | msg.addr = client->addr; | ||
161 | msg.flags = 0; | ||
162 | while (len >= 2) { | 160 | while (len >= 2) { |
163 | msg.buf = (char *) block_data; | 161 | block_len = 0; |
164 | msg.len = 0; | 162 | block_data[block_len++] = reg = data[0]; |
165 | block_data[msg.len++] = reg = data[0]; | ||
166 | do { | 163 | do { |
167 | block_data[msg.len++] = data[1]; | 164 | block_data[block_len++] = data[1]; |
168 | reg++; | 165 | reg++; |
169 | len -= 2; | 166 | len -= 2; |
170 | data += 2; | 167 | data += 2; |
171 | } while (len >= 2 && data[0] == reg && | 168 | } while (len >= 2 && data[0] == reg && |
172 | msg.len < 32); | 169 | block_len < 32); |
173 | if ((ret = i2c_transfer(client->adapter, | 170 | if ((ret = i2c_master_send(client, block_data, |
174 | &msg, 1)) < 0) | 171 | block_len)) < 0) |
175 | break; | 172 | break; |
176 | } | 173 | } |
177 | } else { | 174 | } else { |