From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org,
Arnaud Pouliquen <arnaud.pouliquen@st.com>,
Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 1/2] ASoC: sti-sas: Fix checking return value for ERR_PTR
Date: Mon, 13 Jul 2015 13:25:34 +0800 [thread overview]
Message-ID: <1436765134.21490.1.camel@ingics.com> (raw)
Both devm_regmap_init and syscon_regmap_lookup_by_phandle return ERR_PTR
on failure.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
sound/soc/codecs/sti-sas.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/sti-sas.c b/sound/soc/codecs/sti-sas.c
index 32db2c2..4168b88 100644
--- a/sound/soc/codecs/sti-sas.c
+++ b/sound/soc/codecs/sti-sas.c
@@ -568,17 +568,17 @@ static int sti_sas_driver_probe(struct platform_device *pdev)
/* Request the DAC & SPDIF registers memory region */
drvdata->dac.virt_regmap = devm_regmap_init(&pdev->dev, NULL, drvdata,
drvdata->dev_data->regmap);
- if (!drvdata->dac.virt_regmap) {
+ if (IS_ERR(drvdata->dac.virt_regmap)) {
dev_err(&pdev->dev, "audio registers not enabled\n");
- return -EFAULT;
+ return PTR_ERR(drvdata->dac.virt_regmap);
}
/* Request the syscon region */
drvdata->dac.regmap =
syscon_regmap_lookup_by_phandle(pnode, "st,syscfg");
- if (!drvdata->dac.regmap) {
+ if (IS_ERR(drvdata->dac.regmap)) {
dev_err(&pdev->dev, "syscon registers not available\n");
- return -EFAULT;
+ return PTR_ERR(drvdata->dac.regmap);
}
drvdata->spdif.regmap = drvdata->dac.regmap;
--
2.1.0
next reply other threads:[~2015-07-13 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 5:25 Axel Lin [this message]
2015-07-13 5:26 ` [PATCH 2/2] ASoC: sti-sas: Staticise local symbols Axel Lin
2015-07-13 11:16 ` Applied "ASoC: sti-sas: Staticise local symbols" to the asoc tree Mark Brown
2015-07-13 11:16 ` Applied "ASoC: sti-sas: Fix checking return value for ERR_PTR" " 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=1436765134.21490.1.camel@ingics.com \
--to=axel.lin@ingics.com \
--cc=alsa-devel@alsa-project.org \
--cc=arnaud.pouliquen@st.com \
--cc=broonie@kernel.org \
--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.