From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Liam Girdwood <lgirdwood@gmail.com>, Dan Murphy <dmurphy@ti.com>
Subject: [PATCH] ASoC: tas2552: Return proper error for probe error paths
Date: Wed, 23 Jul 2014 16:42:21 +0800 [thread overview]
Message-ID: <1406104941.666.0.camel@phoenix> (raw)
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(-)
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)
--
1.9.1
next reply other threads:[~2014-07-23 8:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 8:42 Axel Lin [this message]
2014-07-25 17:54 ` [PATCH] ASoC: tas2552: Return proper error for probe error paths Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406104941.666.0.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dmurphy@ti.com \
--cc=lgirdwood@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.