diff options
author | Jinjie Ruan <ruanjinjie@huawei.com> | 2024-09-23 06:00:15 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-09-30 22:55:00 +0200 |
commit | 3eae4a916fc0eb6f85b5d399e10335dbd24dd765 (patch) | |
tree | dfbe30f3d34632ad31cdbb10f1937f57993f66ba /drivers/spi | |
parent | spi: spi-cadence: Fix pm_runtime_set_suspended() with runtime pm enabled (diff) | |
download | linux-3eae4a916fc0eb6f85b5d399e10335dbd24dd765.tar.xz linux-3eae4a916fc0eb6f85b5d399e10335dbd24dd765.zip |
spi: spi-cadence: Fix missing spi_controller_is_target() check
The spi_controller_is_target() check is missing for pm_runtime_disable()
in cdns_spi_remove(), add it.
Fixes: b1b90514eaa3 ("spi: spi-cadence: Add support for Slave mode")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20240923040015.3009329-4-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-cadence.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 087e748d9cc9..3c87d2bf786a 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -701,8 +701,10 @@ static void cdns_spi_remove(struct platform_device *pdev) cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE); - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); + if (!spi_controller_is_target(ctlr)) { + pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + } spi_unregister_controller(ctlr); } |