linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: Detach spi device from driver when unregister it
@ 2017-10-18  7:22 Jeffy Chen
  0 siblings, 0 replies; only message in thread
From: Jeffy Chen @ 2017-10-18  7:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: briannorris, heiko, gregkh, dmitry.torokhov, rjw, dianders, tfiga,
	broonie, seanpaul, thierry.reding, Jeffy Chen, linux-spi

Make sure spi device detached before unregistering it.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

 drivers/spi/spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6e65524cbfd9..9114efb2eb8c 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -648,6 +648,8 @@ void spi_unregister_device(struct spi_device *spi)
 	}
 	if (ACPI_COMPANION(&spi->dev))
 		acpi_device_clear_enumerated(ACPI_COMPANION(&spi->dev));
+
+	device_release_driver(&spi->dev);
 	device_unregister(&spi->dev);
 }
 EXPORT_SYMBOL_GPL(spi_unregister_device);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-18  7:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18  7:22 [PATCH] spi: Detach spi device from driver when unregister it Jeffy Chen

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).