mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 18:43:33 -05:00
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>
This commit is contained in:
parent
ef51d3ff0d
commit
3a9ddaf4dc
1 changed files with 5 additions and 3 deletions
|
@ -1594,10 +1594,12 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
|
||||||
|
|
||||||
bri->get_scl = get_scl_gpio_value;
|
bri->get_scl = get_scl_gpio_value;
|
||||||
bri->set_scl = set_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 */
|
/* Generic SCL recovery */
|
||||||
dev_err(&adap->dev, "No {get|set}_gpio() found, not using recovery\n");
|
if (!bri->set_scl || !bri->get_scl) {
|
||||||
adap->bus_recovery_info = NULL;
|
dev_err(&adap->dev, "No {get|set}_scl() found, not using recovery\n");
|
||||||
|
adap->bus_recovery_info = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue