i2c: core: use I2C locking behaviour also for SMBUS
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 3 Apr 2019 12:40:09 +0000 (14:40 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 16 Apr 2019 11:08:11 +0000 (13:08 +0200)
commit83c42212d2544625b85f44a07d0ad96323e69250
treef9fbca3a009f6e40eecce87ed42fc49eeef059dd
parentbae1d3a05a8b99bd748168bbf8155a1d047c562e
i2c: core: use I2C locking behaviour also for SMBUS

If I2C transfers are executed in atomic contexts, trylock is used
instead of lock. This behaviour was missing for SMBUS, although a lot of
transfers are of SMBUS type, either emulated or direct. So, factor out
the locking routine into a helper and use it for I2C and SMBUS.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c
drivers/i2c/i2c-core-smbus.c
drivers/i2c/i2c-core.h