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 e1718e85f6c4..9f99ee1303e0 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c | |||
@@ -112,24 +112,21 @@ saa7185_write_block (struct i2c_client *client, | |||
112 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 112 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
113 | /* do raw I2C, not smbus compatible */ | 113 | /* do raw I2C, not smbus compatible */ |
114 | struct saa7185 *encoder = i2c_get_clientdata(client); | 114 | struct saa7185 *encoder = i2c_get_clientdata(client); |
115 | struct i2c_msg msg; | ||
116 | u8 block_data[32]; | 115 | u8 block_data[32]; |
116 | int block_len; | ||
117 | 117 | ||
118 | msg.addr = client->addr; | ||
119 | msg.flags = 0; | ||
120 | while (len >= 2) { | 118 | while (len >= 2) { |
121 | msg.buf = (char *) block_data; | 119 | block_len = 0; |
122 | msg.len = 0; | 120 | block_data[block_len++] = reg = data[0]; |
123 | block_data[msg.len++] = reg = data[0]; | ||
124 | do { | 121 | do { |
125 | block_data[msg.len++] = | 122 | block_data[block_len++] = |
126 | encoder->reg[reg++] = data[1]; | 123 | encoder->reg[reg++] = data[1]; |
127 | len -= 2; | 124 | len -= 2; |
128 | data += 2; | 125 | data += 2; |
129 | } while (len >= 2 && data[0] == reg && | 126 | } while (len >= 2 && data[0] == reg && |
130 | msg.len < 32); | 127 | block_len < 32); |
131 | if ((ret = i2c_transfer(client->adapter, | 128 | if ((ret = i2c_master_send(client, block_data, |
132 | &msg, 1)) < 0) | 129 | block_len)) < 0) |
133 | break; | 130 | break; |
134 | } | 131 | } |
135 | } else { | 132 | } else { |