spi: Don't have controller clean up spi device before driver unbind
authorSaravana Kannan <saravanak@google.com>
Wed, 5 May 2021 16:47:34 +0000 (09:47 -0700)
committerMark Brown <broonie@kernel.org>
Fri, 14 May 2021 12:24:56 +0000 (13:24 +0100)
commit27e7db56cf3dffd302bd7ddfacb1d405cf671a2a
tree78860614e503f9a9621589d47c5f0a89c398008e
parent6b69546912a57ff8c31061f98e56383cc0beffd3
spi: Don't have controller clean up spi device before driver unbind

When a spi device is unregistered and triggers a driver unbind, the
driver might need to access the spi device. So, don't have the
controller clean up the spi device before the driver is unbound. Clean
up the spi device after the driver is unbound.

Fixes: c7299fea6769 ("spi: Fix spi device unregister flow")
Reported-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210505164734.175546-1-saravanak@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c