From 9ff906201aee72ef965970b3c7a84ef97c1b7183 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Tue, 2 Mar 2010 12:23:49 +0100 Subject: [PATCH] --- yaml --- r: 185035 b: refs/heads/master c: 0c43ea544c1086fbbed5a6c99ea58eb64674ea8f h: refs/heads/master i: 185033: 83cf059a9f7084e3022cafbc61b430aa5e5e8063 185031: 9e5a80c5ff40b98dd81feefe709ff1c29237fb59 v: v3 --- [refs] | 2 +- trunk/Documentation/i2c/writing-clients | 5 +++-- trunk/drivers/i2c/i2c-core.c | 4 ++-- trunk/include/linux/i2c.h | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 71a76bcc3ed4..b37f6c0c8cdb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eec74a257f0a695688ba44c0f6c1e92dc81459be +refs/heads/master: 0c43ea544c1086fbbed5a6c99ea58eb64674ea8f diff --git a/trunk/Documentation/i2c/writing-clients b/trunk/Documentation/i2c/writing-clients index 0a74603eb671..3219ee0dbfef 100644 --- a/trunk/Documentation/i2c/writing-clients +++ b/trunk/Documentation/i2c/writing-clients @@ -318,8 +318,9 @@ Plain I2C communication These routines read and write some bytes from/to a client. The client contains the i2c address, so you do not have to include it. The second parameter contains the bytes to read/write, the third the number of bytes -to read/write (must be less than the length of the buffer.) Returned is -the actual number of bytes read/written. +to read/write (must be less than the length of the buffer, also should be +less than 64k since msg.len is u16.) Returned is the actual number of bytes +read/written. int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num); diff --git a/trunk/drivers/i2c/i2c-core.c b/trunk/drivers/i2c/i2c-core.c index 4131698008b9..3202a86f420e 100644 --- a/trunk/drivers/i2c/i2c-core.c +++ b/trunk/drivers/i2c/i2c-core.c @@ -1183,7 +1183,7 @@ EXPORT_SYMBOL(i2c_transfer); * i2c_master_send - issue a single I2C message in master transmit mode * @client: Handle to slave device * @buf: Data that will be written to the slave - * @count: How many bytes to write + * @count: How many bytes to write, must be less than 64k since msg.len is u16 * * Returns negative errno, or else the number of bytes written. */ @@ -1210,7 +1210,7 @@ EXPORT_SYMBOL(i2c_master_send); * i2c_master_recv - issue a single I2C message in master receive mode * @client: Handle to slave device * @buf: Where to store data read from slave - * @count: How many bytes to read + * @count: How many bytes to read, must be less than 64k since msg.len is u16 * * Returns negative errno, or else the number of bytes read. */ diff --git a/trunk/include/linux/i2c.h b/trunk/include/linux/i2c.h index 476abd09c921..0a5da639b327 100644 --- a/trunk/include/linux/i2c.h +++ b/trunk/include/linux/i2c.h @@ -53,6 +53,7 @@ struct i2c_board_info; * on a bus (or read from them). Apart from two basic transfer functions to * transmit one message at a time, a more complex version can be used to * transmit an arbitrary number of messages without interruption. + * @count must be be less than 64k since msg.len is u16. */ extern int i2c_master_send(struct i2c_client *client, const char *buf, int count);