diff mbox

ASoC: tas2552: Return proper error for probe error paths

Message ID 1406104941.666.0.camel@phoenix (mailing list archive)
State Accepted
Commit c62f9d8f7fcefe87e362b75c1c6a4333fc1019ac
Headers show

Commit Message

Axel Lin July 23, 2014, 8:42 a.m. UTC
Return error if devm_regulator_bulk_get() or snd_soc_register_codec() fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 sound/soc/codecs/tas2552.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Mark Brown July 25, 2014, 5:54 p.m. UTC | #1
On Wed, Jul 23, 2014 at 04:42:21PM +0800, Axel Lin wrote:
> Return error if devm_regulator_bulk_get() or snd_soc_register_codec() fails.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index f0760af..05f3737 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -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)