Skip to content

Commit 33e5ce6

Browse files
jhovoldgregkh
authored andcommitted
spi: tegra114: fix controller deregistration
[ Upstream commit 9c9c27f ] Make sure to deregister the controller before disabling underlying resources like clocks during driver unbind. Fixes: 5c80964 ("spi: tegra114: 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-22-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> [ kept `host->dev.of_node = pdev->dev.of_node;` context line above the `spi_register_controller()` conversion ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 65eafad commit 33e5ce6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/spi/spi-tegra114.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
14161416
}
14171417

14181418
host->dev.of_node = pdev->dev.of_node;
1419-
ret = devm_spi_register_controller(&pdev->dev, host);
1419+
ret = spi_register_controller(host);
14201420
if (ret < 0) {
14211421
dev_err(&pdev->dev, "can not register to host err %d\n", ret);
14221422
goto exit_free_irq;
@@ -1442,6 +1442,10 @@ static void tegra_spi_remove(struct platform_device *pdev)
14421442
struct spi_controller *host = platform_get_drvdata(pdev);
14431443
struct tegra_spi_data *tspi = spi_controller_get_devdata(host);
14441444

1445+
spi_controller_get(host);
1446+
1447+
spi_unregister_controller(host);
1448+
14451449
free_irq(tspi->irq, tspi);
14461450

14471451
if (tspi->tx_dma_chan)
@@ -1453,6 +1457,8 @@ static void tegra_spi_remove(struct platform_device *pdev)
14531457
pm_runtime_disable(&pdev->dev);
14541458
if (!pm_runtime_status_suspended(&pdev->dev))
14551459
tegra_spi_runtime_suspend(&pdev->dev);
1460+
1461+
spi_controller_put(host);
14561462
}
14571463

14581464
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)