mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
spi: mxs: fix controller deregistration
Make sure to deregister the controller before releasing underlying
resources like DMA during driver unbind.
Fixes: 33e195acf2 ("spi: mxs: use devm_spi_register_master()")
Cc: stable@vger.kernel.org # 3.13
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-4-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
76336f2493
commit
8b0d0011af
|
|
@ -619,7 +619,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
|
|||
if (ret)
|
||||
goto out_pm_runtime_put;
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
ret = spi_register_controller(host);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Cannot register SPI host, %d\n", ret);
|
||||
goto out_pm_runtime_put;
|
||||
|
|
@ -650,11 +650,17 @@ static void mxs_spi_remove(struct platform_device *pdev)
|
|||
spi = spi_controller_get_devdata(host);
|
||||
ssp = &spi->ssp;
|
||||
|
||||
spi_controller_get(host);
|
||||
|
||||
spi_unregister_controller(host);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
if (!pm_runtime_status_suspended(&pdev->dev))
|
||||
mxs_spi_runtime_suspend(&pdev->dev);
|
||||
|
||||
dma_release_channel(ssp->dmach);
|
||||
|
||||
spi_controller_put(host);
|
||||
}
|
||||
|
||||
static struct platform_driver mxs_spi_driver = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user