diff options
author | Dmitry Osipenko | 2021-03-29 22:55:30 +0300 |
---|---|---|
committer | Wolfram Sang | 2021-03-31 10:01:23 +0200 |
commit | c126f7c3b8c41f5ca146e52e70ae927e3be30060 (patch) | |
tree | 67af6989f5dd8433984d56f1072e0b8622d47c9d /drivers/i2c | |
parent | 8f66edb25c4e10f8380c88f4c097158ff611fd10 (diff) |
i2c: Make i2c_recover_bus() to return -EBUSY if bus recovery unimplemented
The i2c_recover_bus() returns -EOPNOTSUPP if bus recovery isn't wired up
by the bus driver, which the case for Tegra I2C driver for example. This
error code is then propagated to I2C client and might be confusing, thus
make i2c_recover_bus() to return -EBUSY instead.
Suggested-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 63ebf722a424..e7be127eeee4 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -249,7 +249,7 @@ EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery); int i2c_recover_bus(struct i2c_adapter *adap) { if (!adap->bus_recovery_info) - return -EOPNOTSUPP; + return -EBUSY; dev_dbg(&adap->dev, "Trying i2c bus recovery\n"); return adap->bus_recovery_info->recover_bus(adap); |