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: tegra20-sflash: fix controller deregistration

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

Fixes: f12f7318c44a ("spi: tegra20-sflash: 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-23-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
ad7310e9 9c9c27ff

+7 -1
+7 -1
drivers/spi/spi-tegra20-sflash.c
··· 505 505 tegra_sflash_writel(tsd, tsd->def_command_reg, SPI_COMMAND); 506 506 pm_runtime_put(&pdev->dev); 507 507 508 - ret = devm_spi_register_controller(&pdev->dev, host); 508 + ret = spi_register_controller(host); 509 509 if (ret < 0) { 510 510 dev_err(&pdev->dev, "can not register to host err %d\n", ret); 511 511 goto exit_pm_disable; ··· 528 528 struct spi_controller *host = platform_get_drvdata(pdev); 529 529 struct tegra_sflash_data *tsd = spi_controller_get_devdata(host); 530 530 531 + spi_controller_get(host); 532 + 533 + spi_unregister_controller(host); 534 + 531 535 free_irq(tsd->irq, tsd); 532 536 533 537 pm_runtime_disable(&pdev->dev); 534 538 if (!pm_runtime_status_suspended(&pdev->dev)) 535 539 tegra_sflash_runtime_suspend(&pdev->dev); 540 + 541 + spi_controller_put(host); 536 542 } 537 543 538 544 #ifdef CONFIG_PM_SLEEP