Skip to contentSkip to conversation

ASoC: tas2552: Return proper error for probe error paths

PATCH Applied Axel Lin 2 participants 2 messages Jul 23, 2014 – Jul 25, 2014

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: tas2552: Return proper error for probe error paths

Return error if devm_regulator_bulk_get() or snd_soc_register_codec() fails.

---
 sound/soc/codecs/tas2552.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/tas2552.c +4 -2
index f0760af..05f3737 100644
@@ -480,8 +480,10 @@ static int tas2552_probe(struct i2c_client *client,
 
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(data->supplies),
 				      data->supplies);
-	if (ret != 0)
+	if (ret != 0) {
 		dev_err(dev, "Failed to request supplies: %d\n", ret);
+		return ret;
+	}
 
 	pm_runtime_set_active(&client->dev);
 	pm_runtime_set_autosuspend_delay(&client->dev, 1000);
@@ -498,7 +500,7 @@ static int tas2552_probe(struct i2c_client *client,
 	if (ret < 0)
 		dev_err(&client->dev, "Failed to register codec: %d\n", ret);
 
-	return 0;
+	return ret;
 }
 
 static int tas2552_i2c_remove(struct i2c_client *client)
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 1 line · Axel Lin

Return error if devm_regulator_bulk_get() or snd_soc_register_codec() fails.

Applied, thanks.