From: Philipp Zabel <p.zabel@pengutronix.de>
To: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
Chen-Yu Tsai <wens@csie.org>, Mark Brown <broonie@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: [PATCH v2 14/14] ASoC: sunxi: simplify optional reset handling
Date: Wed, 15 Mar 2017 12:31:57 +0100 [thread overview]
Message-ID: <20170315113157.13218-1-p.zabel@pengutronix.de> (raw)
As of commit bb475230b8e5 ("reset: make optional functions really
optional"), the reset framework API calls use NULL pointers to describe
optional, non-present reset controls.
This allows to return errors from devm_reset_control_get_optional and to
call reset_control_deassert unconditionally.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
---
sound/soc/sunxi/sun4i-spdif.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index eaefd07a5ed08..cdf8a6d86010c 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -521,13 +521,12 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
if (quirks->has_reset) {
host->rst = devm_reset_control_get_optional(&pdev->dev, NULL);
- if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) {
- ret = -EPROBE_DEFER;
+ if (IS_ERR(host->rst)) {
+ ret = PTR_ERR(host->rst);
dev_err(&pdev->dev, "Failed to get reset: %d\n", ret);
return ret;
}
- if (!IS_ERR(host->rst))
- reset_control_deassert(host->rst);
+ reset_control_deassert(host->rst);
}
ret = devm_snd_soc_register_component(&pdev->dev,
--
2.11.0
reply other threads:[~2017-03-15 11:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170315113157.13218-1-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=wens@csie.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).