[PATCH v2 5/6] spi: rockchip: Move to pm_runtime_resume_and_get
Heiko Stuebner
heiko at sntech.de
Fri Nov 13 05:50:16 PST 2026
From: Heiko Stuebner <heiko.stuebner at cherry.de>
Currently pm_runtime_get_sync() is used, which increments the usage
count even if the resume was not successful.
Move to the more modern pm_runtime_resume_and_get() which handles the
usage counter better.
Signed-off-by: Heiko Stuebner <heiko.stuebner at cherry.de>
---
drivers/spi/spi-rockchip.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 8bb55d52d346..ce1629e5a513 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -255,7 +255,7 @@ static void rockchip_spi_set_cs(struct spi_device *spi, bool enable)
if (cs_asserted) {
/* Keep things powered as long as CS is asserted */
- pm_runtime_get_sync(rs->dev);
+ pm_runtime_resume_and_get(rs->dev);
if (spi_get_csgpiod(spi, 0))
ROCKCHIP_SPI_SET_BITS(rs->regs + ROCKCHIP_SPI_SER, 1);
@@ -734,7 +734,7 @@ static int rockchip_spi_setup(struct spi_device *spi)
return -EINVAL;
}
- pm_runtime_get_sync(rs->dev);
+ pm_runtime_resume_and_get(rs->dev);
cr0 = readl_relaxed(rs->regs + ROCKCHIP_SPI_CTRLR0);
@@ -924,7 +924,7 @@ static void rockchip_spi_remove(struct platform_device *pdev)
{
struct spi_controller *ctlr = platform_get_drvdata(pdev);
- pm_runtime_get_sync(&pdev->dev);
+ pm_runtime_resume_and_get(&pdev->dev);
spi_unregister_controller(ctlr);
--
2.53.0
More information about the Linux-rockchip
mailing list