diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2012-07-10 13:54:54 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2012-07-10 13:54:54 +0000 |
commit | 1164f260abc0ba479ce5413317efbe44972c13cb (patch) | |
tree | 3ab5300b7caf3b17d46b9a361ecae61307d1b341 | |
parent | 42ddae3307ed34e2d4f5805ba6af60f76df3650c (diff) | |
download | i2c-tools-1164f260abc0ba479ce5413317efbe44972c13cb.tar.gz |
libi2c: Use I2C_SMBUS_BLOCK_MAX instead of hard-coding 32
git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6059 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/smbus.c | 16 |
2 files changed, 9 insertions, 8 deletions
@@ -10,6 +10,7 @@ SVN HEAD i2c-stub-from-dump: Be more tolerant on input dump format library: New libi2c library Properly propagate real error codes on read errors + Use I2C_SMBUS_BLOCK_MAX instead of hard-coding 32 3.1.0 (2011-12-04) decode-dimms: Decode module configuration type of DDR SDRAM diff --git a/lib/smbus.c b/lib/smbus.c index d8471ac..6108fe6 100644 --- a/lib/smbus.c +++ b/lib/smbus.c @@ -151,8 +151,8 @@ __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, { union i2c_smbus_data data; int i; - if (length > 32) - length = 32; + if (length > I2C_SMBUS_BLOCK_MAX) + length = I2C_SMBUS_BLOCK_MAX; for (i = 1; i <= length; i++) data.block[i] = values[i-1]; data.block[0] = length; @@ -170,8 +170,8 @@ __s32 i2c_smbus_read_i2c_block_data(int file, __u8 command, __u8 length, union i2c_smbus_data data; int i, err; - if (length > 32) - length = 32; + if (length > I2C_SMBUS_BLOCK_MAX) + length = I2C_SMBUS_BLOCK_MAX; data.block[0] = length; err = i2c_smbus_access(file, I2C_SMBUS_READ, command, @@ -190,8 +190,8 @@ __s32 i2c_smbus_write_i2c_block_data(int file, __u8 command, __u8 length, { union i2c_smbus_data data; int i; - if (length > 32) - length = 32; + if (length > I2C_SMBUS_BLOCK_MAX) + length = I2C_SMBUS_BLOCK_MAX; for (i = 1; i <= length; i++) data.block[i] = values[i-1]; data.block[0] = length; @@ -206,8 +206,8 @@ __s32 i2c_smbus_block_process_call(int file, __u8 command, __u8 length, union i2c_smbus_data data; int i, err; - if (length > 32) - length = 32; + if (length > I2C_SMBUS_BLOCK_MAX) + length = I2C_SMBUS_BLOCK_MAX; for (i = 1; i <= length; i++) data.block[i] = values[i-1]; data.block[0] = length; |