Commit e29f1773 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman

[PATCH] Fix i2c messsage flags in video drivers

While working on the saa7110 driver I found a problem with the way
various video drivers (found on Zoran-based boards) prepare i2c messages
to be used by i2c_transfer. The drivers improperly copy the i2c client
flags as the message flags, while both sets are mostly unrelated. The
net effect in this case is to trigger an I2C block read instead of the
expected I2C block write. The fix is simply not to pass any flag,
because none are needed.

I think this patch qualifies hands down as a "critical bug fix" to be
included in whatever bug-fix-only trees exist these days. As far as I
can see, all Zoran-based boards are broken in 2.6.11 without this patch.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c794976d
...@@ -130,7 +130,7 @@ adv7170_write_block (struct i2c_client *client, ...@@ -130,7 +130,7 @@ adv7170_write_block (struct i2c_client *client,
u8 block_data[32]; u8 block_data[32];
msg.addr = client->addr; msg.addr = client->addr;
msg.flags = client->flags; msg.flags = 0;
while (len >= 2) { while (len >= 2) {
msg.buf = (char *) block_data; msg.buf = (char *) block_data;
msg.len = 0; msg.len = 0;
......
...@@ -126,7 +126,7 @@ adv7175_write_block (struct i2c_client *client, ...@@ -126,7 +126,7 @@ adv7175_write_block (struct i2c_client *client,
u8 block_data[32]; u8 block_data[32];
msg.addr = client->addr; msg.addr = client->addr;
msg.flags = client->flags; msg.flags = 0;
while (len >= 2) { while (len >= 2) {
msg.buf = (char *) block_data; msg.buf = (char *) block_data;
msg.len = 0; msg.len = 0;
......
...@@ -146,7 +146,7 @@ bt819_write_block (struct i2c_client *client, ...@@ -146,7 +146,7 @@ bt819_write_block (struct i2c_client *client,
u8 block_data[32]; u8 block_data[32];
msg.addr = client->addr; msg.addr = client->addr;
msg.flags = client->flags; msg.flags = 0;
while (len >= 2) { while (len >= 2) {
msg.buf = (char *) block_data; msg.buf = (char *) block_data;
msg.len = 0; msg.len = 0;
......
...@@ -163,7 +163,7 @@ saa7114_write_block (struct i2c_client *client, ...@@ -163,7 +163,7 @@ saa7114_write_block (struct i2c_client *client,
u8 block_data[32]; u8 block_data[32];
msg.addr = client->addr; msg.addr = client->addr;
msg.flags = client->flags; msg.flags = 0;
while (len >= 2) { while (len >= 2) {
msg.buf = (char *) block_data; msg.buf = (char *) block_data;
msg.len = 0; msg.len = 0;
......
...@@ -118,7 +118,7 @@ saa7185_write_block (struct i2c_client *client, ...@@ -118,7 +118,7 @@ saa7185_write_block (struct i2c_client *client,
u8 block_data[32]; u8 block_data[32];
msg.addr = client->addr; msg.addr = client->addr;
msg.flags = client->flags; msg.flags = 0;
while (len >= 2) { while (len >= 2) {
msg.buf = (char *) block_data; msg.buf = (char *) block_data;
msg.len = 0; msg.len = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment