From: khali@linux-fr.org Date: Sun, 13 Mar 2005 05:40:46 +0000 (-0800) Subject: [PATCH] Fix i2c messsage flags in video drivers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77dbf03c1e6b17cc08bce7832c6c7db29cbcf4fb;p=thirdparty%2Fkernel%2Fstable.git [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: Jean Delvare Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index 4e1f5554846c3..643bea0a04496 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c @@ -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; diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index 1e24c0b96e823..f7316ddae5fb6 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -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; diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 83857c1dc9514..d1ecce3cd5cc2 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -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; diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index 627457ad77ee8..8df56263a1c59 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c @@ -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; diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index 26d62b43e816c..d6ece63b894a0 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c @@ -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;