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>
This commit is contained in:
parent
8f66edb25c
commit
c126f7c3b8
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user