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/saa7185.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/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 { |