diff options
author | Wolfram Sang <wsa@the-dreams.de> | 2016-05-12 11:25:19 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-05-13 12:37:03 +0200 |
commit | 3a9ddaf4dca87f86f70b88d7710da20abfc9aca1 (patch) | |
tree | 1ed5fc6b0cb2f986a6db2a97a19a3f80200d1fb4 /drivers/i2c | |
parent | i2c: algo-bit: declare i2c_bit_quirk_no_clk_stretch as static (diff) | |
download | linux-3a9ddaf4dca87f86f70b88d7710da20abfc9aca1.tar.xz linux-3a9ddaf4dca87f86f70b88d7710da20abfc9aca1.zip |
i2c: only check scl functions when using generic recovery
A custom recovery function doesn't need these pointers to be populated
because it may work differently internally.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 9da446162529..af11b658984d 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1594,10 +1594,12 @@ static int i2c_register_adapter(struct i2c_adapter *adap) bri->get_scl = get_scl_gpio_value; bri->set_scl = set_scl_gpio_value; - } else if (!bri->set_scl || !bri->get_scl) { + } else if (bri->recover_bus == i2c_generic_scl_recovery) { /* Generic SCL recovery */ - dev_err(&adap->dev, "No {get|set}_gpio() found, not using recovery\n"); - adap->bus_recovery_info = NULL; + if (!bri->set_scl || !bri->get_scl) { + dev_err(&adap->dev, "No {get|set}_scl() found, not using recovery\n"); + adap->bus_recovery_info = NULL; + } } } |