mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: codecs: rt5659: propagate GPIO errors
devm_gpiod_get_optional() may return an error pointer, including
-EPROBE_DEFER, but rt5659_i2c_probe() does not handle these errors
for the ldo1-en GPIO and does not check for errors for the reset GPIO.
Check the return values and propagate GPIO lookup errors.
Fixes: d3cb2de247 ("ASoC: rt5659: add rt5659 codec driver")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Reviewed-by: Alvin Šipraga <alvin.sipraga@analog.com>
Link: https://patch.msgid.link/20261009112204.33199-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
50fb7f7fc7
commit
c1e321bd5c
|
|
@ -4121,10 +4121,14 @@ static int rt5659_i2c_probe(struct i2c_client *i2c)
|
|||
rt5659->gpiod_ldo1_en = devm_gpiod_get_optional(&i2c->dev, "ldo1-en",
|
||||
GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(rt5659->gpiod_ldo1_en))
|
||||
dev_warn(&i2c->dev, "Request ldo1-en GPIO failed\n");
|
||||
return dev_err_probe(&i2c->dev, PTR_ERR(rt5659->gpiod_ldo1_en),
|
||||
"failed to get ldo1-en GPIO\n");
|
||||
|
||||
rt5659->gpiod_reset = devm_gpiod_get_optional(&i2c->dev, "reset",
|
||||
GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(rt5659->gpiod_reset))
|
||||
return dev_err_probe(&i2c->dev, PTR_ERR(rt5659->gpiod_reset),
|
||||
"failed to get reset GPIO\n");
|
||||
|
||||
/* Sleep for 300 ms minimum */
|
||||
msleep(300);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user