Browse Source

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
tags/v4.0
Jean Delvare 13 years ago
parent
commit
bf690d8371
  1. 1
      CHANGES
  2. 16
      lib/smbus.c

1
CHANGES

@ -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

16
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;

Loading…
Cancel
Save