summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitrios Katsaros <patcherwork@gmail.com>2026-01-13 11:58:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-11 13:37:23 +0100
commitb8f8c2758e89fba1ba08afcf505b29a0723202c7 (patch)
tree5c28ead001ae2387ae94ac401a633a6114e924dc
parentb134dead095bc5a58fa2b98b90ae93428cb4b328 (diff)
downloadlinux-b8f8c2758e89fba1ba08afcf505b29a0723202c7.tar.gz
linux-b8f8c2758e89fba1ba08afcf505b29a0723202c7.tar.bz2
linux-b8f8c2758e89fba1ba08afcf505b29a0723202c7.zip
ASoC: tlv320adcx140: Propagate error codes during probe
[ Upstream commit d89aad92cfd15edbd704746f44c98fe687f9366f ] When scanning for the reset pin, we could get an -EPROBE_DEFER. The driver would assume that no reset pin had been defined, which would mean that the chip would never be powered. Now we both respect any error we get from devm_gpiod_get_optional. We also now properly report the missing GPIO definition when 'gpio_reset' is NULL. Signed-off-by: Dimitrios Katsaros <patcherwork@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://patch.msgid.link/20260113-sound-soc-codecs-tvl320adcx140-v4-3-8f7ecec525c8@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/soc/codecs/tlv320adcx140.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 67eef894d0c2..0323d6341c9a 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -1157,6 +1157,9 @@ static int adcx140_i2c_probe(struct i2c_client *i2c)
adcx140->gpio_reset = devm_gpiod_get_optional(adcx140->dev,
"reset", GPIOD_OUT_LOW);
if (IS_ERR(adcx140->gpio_reset))
+ return dev_err_probe(&i2c->dev, PTR_ERR(adcx140->gpio_reset),
+ "Failed to get Reset GPIO\n");
+ if (!adcx140->gpio_reset)
dev_info(&i2c->dev, "Reset GPIO not defined\n");
adcx140->supply_areg = devm_regulator_get_optional(adcx140->dev,