* [PATCH AUTOSEL 4.19 29/37] i2c: gpio: suppress error on probe defer
[not found] <20200318205509.17053-1-sashal@kernel.org>
@ 2020-03-18 20:55 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2020-03-18 20:55 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Hamish Martin, Linus Walleij, Wolfram Sang, Sasha Levin,
linux-i2c
From: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
[ Upstream commit 3747cd2efe7ecb9604972285ab3f60c96cb753a8 ]
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 <hamish.martin@alliedtelesis.co.nz>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index c008d209f0b83..87014d144ccdc 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -248,7 +248,7 @@ static struct gpio_desc *i2c_gpio_get_desc(struct device *dev,
if (ret == -ENOENT)
retdesc = ERR_PTR(-EPROBE_DEFER);
- if (ret != -EPROBE_DEFER)
+ if (PTR_ERR(retdesc) != -EPROBE_DEFER)
dev_err(dev, "error trying to get descriptor: %d\n", ret);
return retdesc;
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-18 20:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200318205509.17053-1-sashal@kernel.org>
2020-03-18 20:55 ` [PATCH AUTOSEL 4.19 29/37] i2c: gpio: suppress error on probe defer Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).