• Peter Rosin's avatar
    i2c: smbus: add unlocked __i2c_smbus_xfer variant · 63453b59
    Peter Rosin authored
    Removes all locking from i2c_smbus_xfer and renames it to __i2c_smbus_xfer,
    then adds a new i2c_smbus_xfer function that simply grabs the lock while
    calling the unlocked variant.
    
    This is not perfectly equivalent, since i2c_smbus_xfer was callable from
    atomic/irq context if you happened to end up emulating SMBus with an I2C
    transfer, and that is no longer the case with this patch. It is unknown
    (to me) if anything depends on that quirk, but it seems fragile enough to
    simply break those cases and require them to call i2c_transfer directly
    instead.
    
    While at it, for consistency rename the 2nd to last argument (size) of
    the i2c_smbus_xfer declaration to protocol and remove the surplus extern
    marker.
    Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
    Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
    63453b59
i2c-core-smbus.c 19.8 KB