Skip to contentSkip to conversation

i2c: designware: Consider SCL GPIO optional

PATCH New Andy Shevchenko 1 participant 1 message Feb 17, 2018

Subsystems (3)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

PATCH 1/1 i2c: designware: Consider SCL GPIO optional

GPIO library can return -ENOSYS for the failed request. Instead of failing ->probe() in this case override error code to 0.

Fixes ca382f5b38f3 ("i2c: designware: add i2c gpio recovery option")
Cc Tim Sander <[email protected]>
---
 drivers/i2c/busses/i2c-designware-master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-master.c +1 -1
index ae691884d071..5778908351a2 100644
@@ -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;
 	}
Signature · 1 line
2.15.1