diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-07-23 04:42:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-25 13:53:52 -0400 |
commit | c62f9d8f7fcefe87e362b75c1c6a4333fc1019ac (patch) | |
tree | 3571cc82fb4ec58bb8d25e3b2709b4046572786b | |
parent | e295a4a43e90d46d3b16374dc908533bb40a3936 (diff) |
ASoC: tas2552: Return proper error for probe error paths
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>
-rw-r--r-- | sound/soc/codecs/tas2552.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index a3ae39448a48..23b32960ff1d 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c | |||
@@ -482,8 +482,10 @@ static int tas2552_probe(struct i2c_client *client, | |||
482 | 482 | ||
483 | ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(data->supplies), | 483 | ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(data->supplies), |
484 | data->supplies); | 484 | data->supplies); |
485 | if (ret != 0) | 485 | if (ret != 0) { |
486 | dev_err(dev, "Failed to request supplies: %d\n", ret); | 486 | dev_err(dev, "Failed to request supplies: %d\n", ret); |
487 | return ret; | ||
488 | } | ||
487 | 489 | ||
488 | pm_runtime_set_active(&client->dev); | 490 | pm_runtime_set_active(&client->dev); |
489 | pm_runtime_set_autosuspend_delay(&client->dev, 1000); | 491 | pm_runtime_set_autosuspend_delay(&client->dev, 1000); |
@@ -500,7 +502,7 @@ static int tas2552_probe(struct i2c_client *client, | |||
500 | if (ret < 0) | 502 | if (ret < 0) |
501 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | 503 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); |
502 | 504 | ||
503 | return 0; | 505 | return ret; |
504 | } | 506 | } |
505 | 507 | ||
506 | static int tas2552_i2c_remove(struct i2c_client *client) | 508 | static int tas2552_i2c_remove(struct i2c_client *client) |