Commit c126f7c3 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Wolfram Sang

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: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 8f66edb2
...@@ -249,7 +249,7 @@ EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery); ...@@ -249,7 +249,7 @@ EXPORT_SYMBOL_GPL(i2c_generic_scl_recovery);
int i2c_recover_bus(struct i2c_adapter *adap) int i2c_recover_bus(struct i2c_adapter *adap)
{ {
if (!adap->bus_recovery_info) if (!adap->bus_recovery_info)
return -EOPNOTSUPP; return -EBUSY;
dev_dbg(&adap->dev, "Trying i2c bus recovery\n"); dev_dbg(&adap->dev, "Trying i2c bus recovery\n");
return adap->bus_recovery_info->recover_bus(adap); return adap->bus_recovery_info->recover_bus(adap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment