Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: gpio: suppress error on probe defer

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>

authored by

Hamish Martin and committed by
Wolfram Sang
3747cd2e bcf3588d

+1 -1
+1 -1
drivers/i2c/busses/i2c-gpio.c
··· 348 348 if (ret == -ENOENT) 349 349 retdesc = ERR_PTR(-EPROBE_DEFER); 350 350 351 - if (ret != -EPROBE_DEFER) 351 + if (PTR_ERR(retdesc) != -EPROBE_DEFER) 352 352 dev_err(dev, "error trying to get descriptor: %d\n", ret); 353 353 354 354 return retdesc;