Skip to content

Commit 65eafad

Browse files
jhovoldgregkh
authored andcommitted
spi: tegra20-sflash: fix controller deregistration
[ Upstream commit ad7310e ] 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> [ kept the redundant `host->dev.of_node = pdev->dev.of_node;` line above the registration call ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fafa9a4 commit 65eafad

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
@@ -506,7 +506,7 @@ static int tegra_sflash_probe(struct platform_device *pdev)
506506
pm_runtime_put(&pdev->dev);
507507

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

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

534538
pm_runtime_disable(&pdev->dev);
535539
if (!pm_runtime_status_suspended(&pdev->dev))
536540
tegra_sflash_runtime_suspend(&pdev->dev);
541+
542+
spi_controller_put(host);
537543
}
538544

539545
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)