diff options
author | Jean Delvare <khali@linux-fr.org> | 2006-03-22 01:48:35 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-23 09:24:30 -0500 |
commit | 9aa45e34d2948f360f8c0e63d10f49015ca51edd (patch) | |
tree | 52b5715c005a81989e0d3660bcffa0a6a9ed0e34 /drivers/media/video/saa7114.c | |
parent | 5a313c59bcc5062fc56088d5ff9289828c4b6626 (diff) |
V4L/DVB (3568k): zoran: Use i2c_master_send when possible
Change all the Zoran (ZR36050/ZR36060) drivers to use i2c_master_send instead
of i2c_transfer when possible. This simplifies the code by a few lines in
each driver.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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 1c29d05307a..849b54cd5c2 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 { |