linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olivier Moysan <olivier.moysan@st.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
	<tiwai@suse.com>, <mcoquelin.stm32@gmail.com>,
	<alexandre.torgue@st.com>, <alsa-devel@alsa-project.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-kernel@vger.kernel.org>, <olivier.moysan@st.com>
Cc: Etienne Carriere <etienne.carriere@st.com>
Subject: [PATCH 1/6] ASoC: stm32: sai: manage error when getting reset controller
Date: Mon, 3 Feb 2020 11:08:09 +0100	[thread overview]
Message-ID: <20200203100814.22944-2-olivier.moysan@st.com> (raw)
In-Reply-To: <20200203100814.22944-1-olivier.moysan@st.com>

Return an error when the SAI driver fails to get a reset controller.
Also add an error trace, except on probe defer status.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
---
 sound/soc/stm/stm32_sai.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index e20267504b16..b824ba6cb028 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -197,12 +197,16 @@ static int stm32_sai_probe(struct platform_device *pdev)
 		return sai->irq;
 
 	/* reset */
-	rst = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (!IS_ERR(rst)) {
-		reset_control_assert(rst);
-		udelay(2);
-		reset_control_deassert(rst);
+	rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL);
+	if (IS_ERR(rst)) {
+		if (PTR_ERR(rst) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Reset controller error %ld\n",
+				PTR_ERR(rst));
+		return PTR_ERR(rst);
 	}
+	reset_control_assert(rst);
+	udelay(2);
+	reset_control_deassert(rst);
 
 	/* Enable peripheral clock to allow register access */
 	ret = clk_prepare_enable(sai->pclk);
-- 
2.17.1


  reply	other threads:[~2020-02-03 10:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 10:08 [PATCH 0/6] ASoC: stm32: improve error management on probe Olivier Moysan
2020-02-03 10:08 ` Olivier Moysan [this message]
2020-02-11 15:49   ` Applied "ASoC: stm32: sai: manage error when getting reset controller" to the asoc tree Mark Brown
2020-02-03 10:08 ` [PATCH 2/6] ASoC: stm32: spdifrx: manage error when getting reset controller Olivier Moysan
2020-02-11 15:49   ` Applied "ASoC: stm32: spdifrx: manage error when getting reset controller" to the asoc tree Mark Brown
2020-02-03 10:08 ` [PATCH 3/6] ASoC: stm32: i2s: manage error when getting reset controller Olivier Moysan
2020-02-11 15:49   ` Applied "ASoC: stm32: i2s: manage error when getting reset controller" to the asoc tree Mark Brown
2020-02-03 10:08 ` [PATCH 4/6] ASoC: stm32: sai: improve error management on probe deferral Olivier Moysan
2020-02-11 15:49   ` Applied "ASoC: stm32: sai: improve error management on probe deferral" to the asoc tree Mark Brown
2020-02-03 10:08 ` [PATCH 5/6] ASoC: stm32: spdifrx: improve error management on probe deferral Olivier Moysan
2020-02-11 15:49   ` Applied "ASoC: stm32: spdifrx: improve error management on probe deferral" to the asoc tree Mark Brown
2020-02-03 10:08 ` [PATCH 6/6] ASoC: stm32: i2s: improve error management on probe deferral Olivier Moysan
2020-02-11 15:49   ` Applied "ASoC: stm32: i2s: improve error management on probe deferral" to the asoc tree 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=20200203100814.22944-2-olivier.moysan@st.com \
    --to=olivier.moysan@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=etienne.carriere@st.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 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).