Skip to content

Commit

Permalink
i2c: designware: Consider SCL GPIO optional
Browse files Browse the repository at this point in the history
GPIO library can return -ENOSYS for the failed request.
Instead of failing ->probe() in this case override error code to 0.

Fixes: ca382f5 ("i2c: designware: add i2c gpio recovery option")
Reported-by: Dominik Brodowski <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
Tested-by: Dominik Brodowski <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
  • Loading branch information
andy-shev authored and Wolfram Sang committed Feb 22, 2018
1 parent c396b9a commit d1fa745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-designware-master.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev)
gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH);
if (IS_ERR(gpio)) {
r = PTR_ERR(gpio);
if (r == -ENOENT)
if (r == -ENOENT || r == -ENOSYS)
return 0;
return r;
}
Expand Down

0 comments on commit d1fa745

Please sign in to comment.