diff options
Diffstat (limited to 'drivers/i2c/i2c-core.h')
-rw-r--r-- | drivers/i2c/i2c-core.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h index deea47c576e5..f9d0c417b5a5 100644 --- a/drivers/i2c/i2c-core.h +++ b/drivers/i2c/i2c-core.h @@ -43,10 +43,13 @@ static inline int __i2c_lock_bus_helper(struct i2c_adapter *adap) { int ret = 0; - if (i2c_in_atomic_xfer_mode()) + if (i2c_in_atomic_xfer_mode()) { + WARN(!adap->algo->master_xfer_atomic && !adap->algo->smbus_xfer_atomic, + "No atomic I2C transfer handler for '%s'\n", dev_name(&adap->dev)); ret = i2c_trylock_bus(adap, I2C_LOCK_SEGMENT) ? 0 : -EAGAIN; - else + } else { i2c_lock_bus(adap, I2C_LOCK_SEGMENT); + } return ret; } |