linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Volker Haspel <volker.haspel@linutronix.de>
To: broonie@kernel.org, linux-kernel@vger.kernel.org
Cc: linux-spi@vger.kernel.org, han.xu@nxp.com,
	volker.haspel@linutronix.de, john.ogness@linutronix.de
Subject: [PATCH v2 1/1] spi: spi-fsl-qspi: use devm_spi_register_controller
Date: Tue, 12 Mar 2019 11:12:03 +0100	[thread overview]
Message-ID: <20190312101203.14207-2-volker.haspel@linutronix.de> (raw)
In-Reply-To: <20190312101203.14207-1-volker.haspel@linutronix.de>

The driver does not clearly unregister the spi controller.
Therefore calling an unbind and bind again will end up in a
Kernel crash.

The function devm_spi_register_controller will automatically
be unregister the SPI device.

Signed-off-by: Volker Haspel <volker.haspel@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 drivers/spi/spi-fsl-qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
index 6a713f78a62e..41a49b93ca60 100644
--- a/drivers/spi/spi-fsl-qspi.c
+++ b/drivers/spi/spi-fsl-qspi.c
@@ -882,7 +882,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 
 	ctlr->dev.of_node = np;
 
-	ret = spi_register_controller(ctlr);
+	ret = devm_spi_register_controller(dev, ctlr);
 	if (ret)
 		goto err_destroy_mutex;
 
-- 
2.11.0


  reply	other threads:[~2019-03-12 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 10:12 [PATCH v2 0/1] spi: spi-fsl-qspi: call spi_unregister_controller Volker Haspel
2019-03-12 10:12 ` Volker Haspel [this message]
2019-03-13 15:39   ` Applied "spi: spi-fsl-qspi: use devm_spi_register_controller" to the spi tree Mark Brown
2019-03-14 15:54   ` Mark Brown
2019-03-12 12:24 ` [PATCH v2 0/1] spi: spi-fsl-qspi: call spi_unregister_controller 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=20190312101203.14207-2-volker.haspel@linutronix.de \
    --to=volker.haspel@linutronix.de \
    --cc=broonie@kernel.org \
    --cc=han.xu@nxp.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.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).