From 0cc43a1806f078f7fd414850d8f1f1761696e4af Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 10 Jan 2011 22:11:23 +0100 Subject: i2c: Constify i2c_client where possible Helper functions for I2C and SMBus transactions don't modify the i2c_client that is passed to them, so it can be marked const. Signed-off-by: Jean Delvare --- include/linux/i2c.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'include/linux') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 56cfe23ffb39..903576df88dc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -57,9 +57,10 @@ struct i2c_board_info; * 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, +extern int i2c_master_send(const struct i2c_client *client, const char *buf, + int count); +extern int i2c_master_recv(const struct i2c_client *client, char *buf, int count); -extern int i2c_master_recv(struct i2c_client *client, char *buf, int count); /* Transfer num messages. */ @@ -78,23 +79,25 @@ extern s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, /* Now follow the 'nice' access routines. These also document the calling conventions of i2c_smbus_xfer. */ -extern s32 i2c_smbus_read_byte(struct i2c_client *client); -extern s32 i2c_smbus_write_byte(struct i2c_client *client, u8 value); -extern s32 i2c_smbus_read_byte_data(struct i2c_client *client, u8 command); -extern s32 i2c_smbus_write_byte_data(struct i2c_client *client, +extern s32 i2c_smbus_read_byte(const struct i2c_client *client); +extern s32 i2c_smbus_write_byte(const struct i2c_client *client, u8 value); +extern s32 i2c_smbus_read_byte_data(const struct i2c_client *client, + u8 command); +extern s32 i2c_smbus_write_byte_data(const struct i2c_client *client, u8 command, u8 value); -extern s32 i2c_smbus_read_word_data(struct i2c_client *client, u8 command); -extern s32 i2c_smbus_write_word_data(struct i2c_client *client, +extern s32 i2c_smbus_read_word_data(const struct i2c_client *client, + u8 command); +extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, u8 command, u16 value); /* Returns the number of read bytes */ -extern s32 i2c_smbus_read_block_data(struct i2c_client *client, +extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, u8 command, u8 *values); -extern s32 i2c_smbus_write_block_data(struct i2c_client *client, +extern s32 i2c_smbus_write_block_data(const struct i2c_client *client, u8 command, u8 length, const u8 *values); /* Returns the number of read bytes */ -extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, +extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client, u8 command, u8 length, u8 *values); -extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, +extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, u8 command, u8 length, const u8 *values); #endif /* I2C */ -- cgit v1.2.3-59-g8ed1b