diff options
Diffstat (limited to 'drivers/media/video/saa7185.c')
-rw-r--r-- | drivers/media/video/saa7185.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index 3ed0edb870a4..67dfa7186453 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c | |||
@@ -113,24 +113,21 @@ saa7185_write_block (struct i2c_client *client, | |||
113 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 113 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
114 | /* do raw I2C, not smbus compatible */ | 114 | /* do raw I2C, not smbus compatible */ |
115 | struct saa7185 *encoder = i2c_get_clientdata(client); | 115 | struct saa7185 *encoder = i2c_get_clientdata(client); |
116 | struct i2c_msg msg; | ||
117 | u8 block_data[32]; | 116 | u8 block_data[32]; |
117 | int block_len; | ||
118 | 118 | ||
119 | msg.addr = client->addr; | ||
120 | msg.flags = 0; | ||
121 | while (len >= 2) { | 119 | while (len >= 2) { |
122 | msg.buf = (char *) block_data; | 120 | block_len = 0; |
123 | msg.len = 0; | 121 | block_data[block_len++] = reg = data[0]; |
124 | block_data[msg.len++] = reg = data[0]; | ||
125 | do { | 122 | do { |
126 | block_data[msg.len++] = | 123 | block_data[block_len++] = |
127 | encoder->reg[reg++] = data[1]; | 124 | encoder->reg[reg++] = data[1]; |
128 | len -= 2; | 125 | len -= 2; |
129 | data += 2; | 126 | data += 2; |
130 | } while (len >= 2 && data[0] == reg && | 127 | } while (len >= 2 && data[0] == reg && |
131 | msg.len < 32); | 128 | block_len < 32); |
132 | if ((ret = i2c_transfer(client->adapter, | 129 | if ((ret = i2c_master_send(client, block_data, |
133 | &msg, 1)) < 0) | 130 | block_len)) < 0) |
134 | break; | 131 | break; |
135 | } | 132 | } |
136 | } else { | 133 | } else { |