• Jean Delvare's avatar
    i2c: Fix the i2c_smbus_read_i2c_block_data() prototype · 4b2643d7
    Jean Delvare authored
    Let the drivers specify how many bytes they want to read with
    i2c_smbus_read_i2c_block_data(). So far, the block count was
    hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
    Many driver authors complained about this before, and I believe it's
    about time to fix it. Right now, authors have to do technically stupid
    things, such as individual byte reads or full-fledged I2C messaging,
    to work around the problem. We do not want to encourage that.
    
    I even found that some bus drivers (e.g. i2c-amd8111) already
    implemented I2C block read the "right" way, that is, they didn't
    follow the old, broken standard. The fact that it was never noticed
    before just shows how little i2c_smbus_read_i2c_block_data() was used,
    which isn't that surprising given how broken its prototype was so far.
    
    There are some obvious compatiblity considerations:
    * This changes the i2c_smbus_read_i2c_block_data() prototype. Users
      outside the kernel tree will notice at ...
    4b2643d7
i2c-dev.c 13.2 KB