mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
spi: sun4i: fix controller deregistration
Make sure to deregister the controller before disabling underlying
resources like clocks during driver unbind.
Fixes: b5f6517948 ("spi: sunxi: Add Allwinner A10 SPI controller driver")
Cc: stable@vger.kernel.org # 3.15
Cc: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-19-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -504,7 +504,7 @@ static int sun4i_spi_probe(struct platform_device *pdev)
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
pm_runtime_idle(&pdev->dev);
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
ret = spi_register_controller(host);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "cannot register SPI host\n");
|
||||
goto err_pm_disable;
|
||||
@@ -522,7 +522,15 @@ err_free_host:
|
||||
|
||||
static void sun4i_spi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct spi_controller *host = platform_get_drvdata(pdev);
|
||||
|
||||
spi_controller_get(host);
|
||||
|
||||
spi_unregister_controller(host);
|
||||
|
||||
pm_runtime_force_suspend(&pdev->dev);
|
||||
|
||||
spi_controller_put(host);
|
||||
}
|
||||
|
||||
static const struct of_device_id sun4i_spi_match[] = {
|
||||
|
||||
Reference in New Issue
Block a user