mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 04:21:09 -04:00
spi: ti-qspi: fix controller deregistration
Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Note that the controller is suspended before disabling and releasing resources since commit3ac066e222("spi: spi-ti-qspi: Suspend the queue before removing the device") which avoids issues like unclocked accesses but prevents SPI device drivers from doing I/O during deregistration. Fixes:3b3a80019f("spi: ti-qspi: one only one interrupt handler") Cc: stable@vger.kernel.org # 3.13 Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260410081757.503099-24-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -888,7 +888,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
|
||||
qspi->mmap_enabled = false;
|
||||
qspi->current_cs = -1;
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
ret = spi_register_controller(host);
|
||||
if (!ret)
|
||||
return 0;
|
||||
|
||||
@@ -903,19 +903,17 @@ static int ti_qspi_probe(struct platform_device *pdev)
|
||||
static void ti_qspi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ti_qspi *qspi = platform_get_drvdata(pdev);
|
||||
int rc;
|
||||
|
||||
rc = spi_controller_suspend(qspi->host);
|
||||
if (rc) {
|
||||
dev_alert(&pdev->dev, "spi_controller_suspend() failed (%pe)\n",
|
||||
ERR_PTR(rc));
|
||||
return;
|
||||
}
|
||||
spi_controller_get(qspi->host);
|
||||
|
||||
spi_unregister_controller(qspi->host);
|
||||
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
ti_qspi_dma_cleanup(qspi);
|
||||
|
||||
spi_controller_put(qspi->host);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops ti_qspi_pm_ops = {
|
||||
|
||||
Reference in New Issue
Block a user