Skip to content

Commit ad7310e

Browse files
jhovoldbroonie
authored andcommitted
spi: tegra20-sflash: fix controller deregistration
Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Fixes: f12f731 ("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>
1 parent 9c9c27f commit ad7310e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/spi/spi-tegra20-sflash.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ static int tegra_sflash_probe(struct platform_device *pdev)
505505
tegra_sflash_writel(tsd, tsd->def_command_reg, SPI_COMMAND);
506506
pm_runtime_put(&pdev->dev);
507507

508-
ret = devm_spi_register_controller(&pdev->dev, host);
508+
ret = spi_register_controller(host);
509509
if (ret < 0) {
510510
dev_err(&pdev->dev, "can not register to host err %d\n", ret);
511511
goto exit_pm_disable;
@@ -528,11 +528,17 @@ static void tegra_sflash_remove(struct platform_device *pdev)
528528
struct spi_controller *host = platform_get_drvdata(pdev);
529529
struct tegra_sflash_data *tsd = spi_controller_get_devdata(host);
530530

531+
spi_controller_get(host);
532+
533+
spi_unregister_controller(host);
534+
531535
free_irq(tsd->irq, tsd);
532536

533537
pm_runtime_disable(&pdev->dev);
534538
if (!pm_runtime_status_suspended(&pdev->dev))
535539
tegra_sflash_runtime_suspend(&pdev->dev);
540+
541+
spi_controller_put(host);
536542
}
537543

538544
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)