summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core-smbus.c
diff options
context:
space:
mode:
authorWolfram Sang2019-04-25 16:19:48 +0200
committerWolfram Sang2019-05-03 16:44:51 +0200
commit5d756112da49af8798620fc788ff4c730c7d5574 (patch)
tree2b417de7894cf5cfee07a5faf601f895a4a4db05 /drivers/i2c/i2c-core-smbus.c
parenti2c: core: ratelimit 'transfer when suspended' errors (diff)
downloadkernel-qcow2-linux-5d756112da49af8798620fc788ff4c730c7d5574.tar.gz
kernel-qcow2-linux-5d756112da49af8798620fc788ff4c730c7d5574.tar.xz
kernel-qcow2-linux-5d756112da49af8798620fc788ff4c730c7d5574.zip
i2c: core: apply 'is_suspended' check for SMBus, too
We checked I2C calls, but not SMBus. Refactor the helper to an inline function and use it for both, I2C and SMBus. Fixes: 9ac6cb5fbb17 ("i2c: add suspended flag and accessors for i2c adapters") Reported-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core-smbus.c')
-rw-r--r--drivers/i2c/i2c-core-smbus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c
index fdb0fb9fb9aa..788d42f2aad9 100644
--- a/drivers/i2c/i2c-core-smbus.c
+++ b/drivers/i2c/i2c-core-smbus.c
@@ -555,6 +555,10 @@ s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
int try;
s32 res;
+ res = __i2c_check_suspended(adapter);
+ if (res)
+ return res;
+
/* If enabled, the following two tracepoints are conditional on
* read_write and protocol.
*/