]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix i2c messsage flags in video drivers
authorJean Delvare <khali@linux-fr.org>
Sat, 12 Mar 2005 13:40:46 +0000 (05:40 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 12 Mar 2005 13:40:46 +0000 (05:40 -0800)
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: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/adv7170.c
drivers/media/video/adv7175.c
drivers/media/video/bt819.c
drivers/media/video/saa7114.c
drivers/media/video/saa7185.c

index 4e1f5554846c3780bfa1315822838711af64b0d4..643bea0a04496e6de713beea05dad04a3e44727e 100644 (file)
@@ -130,7 +130,7 @@ adv7170_write_block (struct i2c_client *client,
                u8 block_data[32];
 
                msg.addr = client->addr;
-               msg.flags = client->flags;
+               msg.flags = 0;
                while (len >= 2) {
                        msg.buf = (char *) block_data;
                        msg.len = 0;
index 1e24c0b96e823545487f0a0e2203ad7d4cf8ccb2..f7316ddae5fb6dc871a57cba5a5c8fcb2c998268 100644 (file)
@@ -126,7 +126,7 @@ adv7175_write_block (struct i2c_client *client,
                u8 block_data[32];
 
                msg.addr = client->addr;
-               msg.flags = client->flags;
+               msg.flags = 0;
                while (len >= 2) {
                        msg.buf = (char *) block_data;
                        msg.len = 0;
index 83857c1dc9514a247af992902ff285079b38d985..d1ecce3cd5cc2527c3bc2942e4eab6d47ef2a862 100644 (file)
@@ -146,7 +146,7 @@ bt819_write_block (struct i2c_client *client,
                u8 block_data[32];
 
                msg.addr = client->addr;
-               msg.flags = client->flags;
+               msg.flags = 0;
                while (len >= 2) {
                        msg.buf = (char *) block_data;
                        msg.len = 0;
index 627457ad77ee8d7420ad4ceda2f17eb3674c738c..8df56263a1c5935b762afea225010c25e93b15ec 100644 (file)
@@ -163,7 +163,7 @@ saa7114_write_block (struct i2c_client *client,
                u8 block_data[32];
 
                msg.addr = client->addr;
-               msg.flags = client->flags;
+               msg.flags = 0;
                while (len >= 2) {
                        msg.buf = (char *) block_data;
                        msg.len = 0;
index 26d62b43e816c3cecc07adb974ca013cbaffba16..d6ece63b894a0734780093330a9fadc7186c781c 100644 (file)
@@ -118,7 +118,7 @@ saa7185_write_block (struct i2c_client *client,
                u8 block_data[32];
 
                msg.addr = client->addr;
-               msg.flags = client->flags;
+               msg.flags = 0;
                while (len >= 2) {
                        msg.buf = (char *) block_data;
                        msg.len = 0;