spi: spi-cadence: Fix pm_runtime_set_suspended() with runtime pm enabled

It is not valid to call pm_runtime_set_suspended() for devices
with runtime PM enabled because it returns -EAGAIN if it is enabled
already and working. So, call pm_runtime_disable() before to fix it.

Fixes: d36ccd9f7ea4 ("spi: cadence: Runtime pm adaptation")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20240923040015.3009329-3-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by Jinjie Ruan and committed by Mark Brown 67d4a70f b6e05ba0

+2 -2
+2 -2
drivers/spi/spi-cadence.c
··· 678 679 clk_dis_all: 680 if (!spi_controller_is_target(ctlr)) { 681 - pm_runtime_set_suspended(&pdev->dev); 682 pm_runtime_disable(&pdev->dev); 683 } 684 remove_ctlr: 685 spi_controller_put(ctlr); ··· 701 702 cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE); 703 704 - pm_runtime_set_suspended(&pdev->dev); 705 pm_runtime_disable(&pdev->dev); 706 707 spi_unregister_controller(ctlr); 708 }
··· 678 679 clk_dis_all: 680 if (!spi_controller_is_target(ctlr)) { 681 pm_runtime_disable(&pdev->dev); 682 + pm_runtime_set_suspended(&pdev->dev); 683 } 684 remove_ctlr: 685 spi_controller_put(ctlr); ··· 701 702 cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE); 703 704 pm_runtime_disable(&pdev->dev); 705 + pm_runtime_set_suspended(&pdev->dev); 706 707 spi_unregister_controller(ctlr); 708 }