blob: a4627a26fa06696e6bbff65ccd8a4516b842f817 [file] [log] [blame]
From 46e530915d0e57aa4b19477320f7d804c4367617 Mon Sep 17 00:00:00 2001
From: Hamish Martin <>
Date: Tue, 10 Mar 2020 10:16:18 +1300
Subject: [PATCH] i2c: gpio: suppress error on probe defer
commit 3747cd2efe7ecb9604972285ab3f60c96cb753a8 upstream.
If a GPIO we are trying to use is not available and we are deferring
the probe, don't output an error message.
This seems to have been the intent of commit 05c74778858d
("i2c: gpio: Add support for named gpios in DT") but the error was
still output due to not checking the updated 'retdesc'.
Fixes: 05c74778858d ("i2c: gpio: Add support for named gpios in DT")
Signed-off-by: Hamish Martin <>
Acked-by: Linus Walleij <>
Signed-off-by: Wolfram Sang <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 3a9e840a3546..a4a6825c8758 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -348,7 +348,7 @@ static struct gpio_desc *i2c_gpio_get_desc(struct device *dev,
if (ret == -ENOENT)
- if (ret != -EPROBE_DEFER)
+ if (PTR_ERR(retdesc) != -EPROBE_DEFER)
dev_err(dev, "error trying to get descriptor: %d\n", ret);
return retdesc;