mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
spi: st-ssc4: fix controller deregistration
Make sure to deregister the controller before disabling underlying
resources like clocks during driver unbind.
Fixes: 9e862375c5 ("spi: Add new driver for STMicroelectronics' SPI Controller")
Cc: stable@vger.kernel.org # 4.0
Cc: Lee Jones <lee@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-18-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
123d17dbc5
commit
1985737401
|
|
@ -349,7 +349,7 @@ static int spi_st_probe(struct platform_device *pdev)
|
|||
|
||||
platform_set_drvdata(pdev, host);
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
ret = spi_register_controller(host);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to register host\n");
|
||||
goto rpm_disable;
|
||||
|
|
@ -371,10 +371,16 @@ static void spi_st_remove(struct platform_device *pdev)
|
|||
struct spi_controller *host = platform_get_drvdata(pdev);
|
||||
struct spi_st *spi_st = spi_controller_get_devdata(host);
|
||||
|
||||
spi_controller_get(host);
|
||||
|
||||
spi_unregister_controller(host);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
clk_disable_unprepare(spi_st->clk);
|
||||
|
||||
spi_controller_put(host);
|
||||
|
||||
pinctrl_pm_select_sleep_state(&pdev->dev);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user