Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: sun4i: fix controller deregistration

Make sure to deregister the controller before disabling underlying
resources like clocks during driver unbind.

Fixes: b5f6517948cc ("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>

authored by

Johan Hovold and committed by
Mark Brown
42108a2f 19857374

+9 -1
+9 -1
drivers/spi/spi-sun4i.c
··· 504 504 pm_runtime_enable(&pdev->dev); 505 505 pm_runtime_idle(&pdev->dev); 506 506 507 - ret = devm_spi_register_controller(&pdev->dev, host); 507 + ret = spi_register_controller(host); 508 508 if (ret) { 509 509 dev_err(&pdev->dev, "cannot register SPI host\n"); 510 510 goto err_pm_disable; ··· 522 522 523 523 static void sun4i_spi_remove(struct platform_device *pdev) 524 524 { 525 + struct spi_controller *host = platform_get_drvdata(pdev); 526 + 527 + spi_controller_get(host); 528 + 529 + spi_unregister_controller(host); 530 + 525 531 pm_runtime_force_suspend(&pdev->dev); 532 + 533 + spi_controller_put(host); 526 534 } 527 535 528 536 static const struct of_device_id sun4i_spi_match[] = {