Commit 8e71321d authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: cs35l35: Clear reset_gpio on the error path in probe

The error path in probe attempts to put the device back into reset.
Should we fail to get the reset_gpio (such as a probe defer) we will
leave the error value in there, which the gpiod_set_value_cansleep on
the error path will attempt to deference.

Fix this issue by clearing reset_gpio before we head into the error
path.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: default avatarBrian Austin <brian.austin@cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5d3d0ad6
...@@ -1412,10 +1412,10 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client, ...@@ -1412,10 +1412,10 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client,
GPIOD_OUT_LOW); GPIOD_OUT_LOW);
if (IS_ERR(cs35l35->reset_gpio)) { if (IS_ERR(cs35l35->reset_gpio)) {
ret = PTR_ERR(cs35l35->reset_gpio); ret = PTR_ERR(cs35l35->reset_gpio);
cs35l35->reset_gpio = NULL;
if (ret == -EBUSY) { if (ret == -EBUSY) {
dev_info(dev, dev_info(dev,
"Reset line busy, assuming shared reset\n"); "Reset line busy, assuming shared reset\n");
cs35l35->reset_gpio = NULL;
} else { } else {
dev_err(dev, "Failed to get reset GPIO: %d\n", ret); dev_err(dev, "Failed to get reset GPIO: %d\n", ret);
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment