Skip to content

Commit

Permalink
ASoC: tas2552: Return proper error for probe error paths
Browse files Browse the repository at this point in the history
Return error if devm_regulator_bulk_get() or snd_soc_register_codec() fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jul 25, 2014
1 parent e295a4a commit c62f9d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/soc/codecs/tas2552.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,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);
Expand All @@ -500,7 +502,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)
Expand Down

0 comments on commit c62f9d8

Please sign in to comment.