All of lore.kernel.org
 help / color / mirror / Atom feed
From: <patrice.chotard@st.com>
To: Mark Brown <broonie@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	<linux-spi@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Cc: <patrice.chotard@st.com>, <christophe.kerello@st.com>,
	Etienne Carriere <etienne.carriere@st.com>
Subject: [PATCH 1/2] spi: stm32-qspi: defer probe for reset controller
Date: Mon, 3 Feb 2020 14:50:47 +0100	[thread overview]
Message-ID: <20200203135048.1299-2-patrice.chotard@st.com> (raw)
In-Reply-To: <20200203135048.1299-1-patrice.chotard@st.com>

From: Etienne Carriere <etienne.carriere@st.com>

Changes stm32 QSPI driver to defer its probe operation when a reset
controller device have not yet probed but is registered in the
system.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 drivers/spi/spi-stm32-qspi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 4ef569b47aa6..13bb64bf4c8f 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -615,7 +615,11 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	}
 
 	rstc = devm_reset_control_get_exclusive(dev, NULL);
-	if (!IS_ERR(rstc)) {
+	if (IS_ERR(rstc)) {
+		ret = PTR_ERR(rstc);
+		if (ret == -EPROBE_DEFER)
+			goto err;
+	} else {
 		reset_control_assert(rstc);
 		udelay(2);
 		reset_control_deassert(rstc);
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: <patrice.chotard-qxv4g6HH51o@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Maxime Coquelin
	<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
	<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	<linux-stm32-XDFAJ8BFU24N7RejjzZ/Li2xQDfSxrLKVpNB7YpNyf8@public.gmane.org>,
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: <patrice.chotard-qxv4g6HH51o@public.gmane.org>,
	<christophe.kerello-qxv4g6HH51o@public.gmane.org>,
	Etienne Carriere <etienne.carriere-qxv4g6HH51o@public.gmane.org>
Subject: [PATCH 1/2] spi: stm32-qspi: defer probe for reset controller
Date: Mon, 3 Feb 2020 14:50:47 +0100	[thread overview]
Message-ID: <20200203135048.1299-2-patrice.chotard@st.com> (raw)
In-Reply-To: <20200203135048.1299-1-patrice.chotard-qxv4g6HH51o@public.gmane.org>

From: Etienne Carriere <etienne.carriere-qxv4g6HH51o@public.gmane.org>

Changes stm32 QSPI driver to defer its probe operation when a reset
controller device have not yet probed but is registered in the
system.

Signed-off-by: Etienne Carriere <etienne.carriere-qxv4g6HH51o@public.gmane.org>
Signed-off-by: Patrice Chotard <patrice.chotard-qxv4g6HH51o@public.gmane.org>
---
 drivers/spi/spi-stm32-qspi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 4ef569b47aa6..13bb64bf4c8f 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -615,7 +615,11 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	}
 
 	rstc = devm_reset_control_get_exclusive(dev, NULL);
-	if (!IS_ERR(rstc)) {
+	if (IS_ERR(rstc)) {
+		ret = PTR_ERR(rstc);
+		if (ret == -EPROBE_DEFER)
+			goto err;
+	} else {
 		reset_control_assert(rstc);
 		udelay(2);
 		reset_control_deassert(rstc);
-- 
2.17.1

WARNING: multiple messages have this Message-ID (diff)
From: <patrice.chotard@st.com>
To: Mark Brown <broonie@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	<linux-spi@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Cc: Etienne Carriere <etienne.carriere@st.com>,
	christophe.kerello@st.com, patrice.chotard@st.com
Subject: [PATCH 1/2] spi: stm32-qspi: defer probe for reset controller
Date: Mon, 3 Feb 2020 14:50:47 +0100	[thread overview]
Message-ID: <20200203135048.1299-2-patrice.chotard@st.com> (raw)
In-Reply-To: <20200203135048.1299-1-patrice.chotard@st.com>

From: Etienne Carriere <etienne.carriere@st.com>

Changes stm32 QSPI driver to defer its probe operation when a reset
controller device have not yet probed but is registered in the
system.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 drivers/spi/spi-stm32-qspi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 4ef569b47aa6..13bb64bf4c8f 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -615,7 +615,11 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	}
 
 	rstc = devm_reset_control_get_exclusive(dev, NULL);
-	if (!IS_ERR(rstc)) {
+	if (IS_ERR(rstc)) {
+		ret = PTR_ERR(rstc);
+		if (ret == -EPROBE_DEFER)
+			goto err;
+	} else {
 		reset_control_assert(rstc);
 		udelay(2);
 		reset_control_deassert(rstc);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-02-03 13:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03 13:50 [PATCH 0/2] spi: stm32-qspi: rework probe error path patrice.chotard
2020-02-03 13:50 ` patrice.chotard
2020-02-03 13:50 ` patrice.chotard-qxv4g6HH51o
2020-02-03 13:50 ` patrice.chotard [this message]
2020-02-03 13:50   ` [PATCH 1/2] spi: stm32-qspi: defer probe for reset controller patrice.chotard
2020-02-03 13:50   ` patrice.chotard-qxv4g6HH51o
2020-02-11 15:51   ` Applied "spi: stm32-qspi: defer probe for reset controller" to the spi tree Mark Brown
2020-02-11 15:51     ` Mark Brown
2020-02-11 15:51     ` Mark Brown
2020-02-03 13:50 ` [PATCH 2/2] spi: stm32-qspi: properly manage probe errors patrice.chotard
2020-02-03 13:50   ` patrice.chotard
2020-02-11 15:51   ` Applied "spi: stm32-qspi: properly manage probe errors" to the spi tree Mark Brown
2020-02-11 15:51     ` Mark Brown
2020-02-11 15:51     ` 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=20200203135048.1299-2-patrice.chotard@st.com \
    --to=patrice.chotard@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=broonie@kernel.org \
    --cc=christophe.kerello@st.com \
    --cc=etienne.carriere@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@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.