From: Axel Lin Date: Wed, 23 Jul 2014 08:42:21 +0000 (+0800) Subject: ASoC: tas2552: Return proper error for probe error paths X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c62f9d8f7fcefe87e362b75c1c6a4333fc1019ac;p=linux-beck.git 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 Signed-off-by: Mark Brown --- 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, 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); @@ -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)