[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20171018072208.9791-1-jeffy.chen@rock-chips.com>
Date: Wed, 18 Oct 2017 15:22:08 +0800
From: Jeffy Chen <jeffy.chen@...k-chips.com>
To: linux-kernel@...r.kernel.org
Cc: briannorris@...omium.org, heiko@...ech.de,
gregkh@...uxfoundation.org, dmitry.torokhov@...il.com,
rjw@...ysocki.net, dianders@...omium.org, tfiga@...omium.org,
broonie@...nel.org, seanpaul@...omium.org,
thierry.reding@...il.com, Jeffy Chen <jeffy.chen@...k-chips.com>,
linux-spi@...r.kernel.org
Subject: [PATCH] spi: Detach spi device from driver when unregister it
Make sure spi device detached before unregistering it.
Signed-off-by: Jeffy Chen <jeffy.chen@...k-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
Powered by blists - more mailing lists