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/adv7170.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/adv7170.c')
-rw-r--r-- | drivers/media/video/adv7170.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index 4ce07ae62dac..d18bf9097dc9 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c | |||
@@ -125,24 +125,21 @@ adv7170_write_block (struct i2c_client *client, | |||
125 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 125 | if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
126 | /* do raw I2C, not smbus compatible */ | 126 | /* do raw I2C, not smbus compatible */ |
127 | struct adv7170 *encoder = i2c_get_clientdata(client); | 127 | struct adv7170 *encoder = i2c_get_clientdata(client); |
128 | struct i2c_msg msg; | ||
129 | u8 block_data[32]; | 128 | u8 block_data[32]; |
129 | int block_len; | ||
130 | 130 | ||
131 | msg.addr = client->addr; | ||
132 | msg.flags = 0; | ||
133 | while (len >= 2) { | 131 | while (len >= 2) { |
134 | msg.buf = (char *) block_data; | 132 | block_len = 0; |
135 | msg.len = 0; | 133 | block_data[block_len++] = reg = data[0]; |
136 | block_data[msg.len++] = reg = data[0]; | ||
137 | do { | 134 | do { |
138 | block_data[msg.len++] = | 135 | block_data[block_len++] = |
139 | encoder->reg[reg++] = data[1]; | 136 | encoder->reg[reg++] = data[1]; |
140 | len -= 2; | 137 | len -= 2; |
141 | data += 2; | 138 | data += 2; |
142 | } while (len >= 2 && data[0] == reg && | 139 | } while (len >= 2 && data[0] == reg && |
143 | msg.len < 32); | 140 | block_len < 32); |
144 | if ((ret = i2c_transfer(client->adapter, | 141 | if ((ret = i2c_master_send(client, block_data, |
145 | &msg, 1)) < 0) | 142 | block_len)) < 0) |
146 | break; | 143 | break; |
147 | } | 144 | } |
148 | } else { | 145 | } else { |