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: slave-mt27xx: fix controller deregistration

Make sure to deregister the controller before disabling underlying
resources like clocks (by disabling runtime PM) during driver unbind.

Fixes: 805be7ddf367 ("spi: mediatek: add spi slave for Mediatek MT2712")
Cc: stable@vger.kernel.org # 4.20
Cc: Leilk Liu <leilk.liu@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-16-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
ab840cbd 0f252366

+9 -1
+9 -1
drivers/spi/spi-slave-mt27xx.c
··· 453 453 454 454 pm_runtime_enable(&pdev->dev); 455 455 456 - ret = devm_spi_register_controller(&pdev->dev, ctlr); 456 + ret = spi_register_controller(ctlr); 457 457 clk_disable_unprepare(mdata->spi_clk); 458 458 if (ret) { 459 459 dev_err(&pdev->dev, ··· 473 473 474 474 static void mtk_spi_slave_remove(struct platform_device *pdev) 475 475 { 476 + struct spi_controller *ctlr = platform_get_drvdata(pdev); 477 + 478 + spi_controller_get(ctlr); 479 + 480 + spi_unregister_controller(ctlr); 481 + 476 482 pm_runtime_disable(&pdev->dev); 483 + 484 + spi_controller_put(ctlr); 477 485 } 478 486 479 487 #ifdef CONFIG_PM_SLEEP