Make sure spi device detached before unregistering it. Signed-off-by: Jeffy Chen <jeffy.chen@xxxxxxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html