Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: spi-imx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220414085343.2541608-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Minghao Chi and committed by
Mark Brown
7d34ff58 b9db82e5

+2 -4
+2 -4
drivers/spi/spi-imx.c
··· 1572 1572 struct spi_imx_data *spi_imx = spi_master_get_devdata(master); 1573 1573 int ret; 1574 1574 1575 - ret = pm_runtime_get_sync(spi_imx->dev); 1575 + ret = pm_runtime_resume_and_get(spi_imx->dev); 1576 1576 if (ret < 0) { 1577 - pm_runtime_put_noidle(spi_imx->dev); 1578 1577 dev_err(spi_imx->dev, "failed to enable clock\n"); 1579 1578 return ret; 1580 1579 } ··· 1792 1793 1793 1794 spi_bitbang_stop(&spi_imx->bitbang); 1794 1795 1795 - ret = pm_runtime_get_sync(spi_imx->dev); 1796 + ret = pm_runtime_resume_and_get(spi_imx->dev); 1796 1797 if (ret < 0) { 1797 - pm_runtime_put_noidle(spi_imx->dev); 1798 1798 dev_err(spi_imx->dev, "failed to enable clock\n"); 1799 1799 return ret; 1800 1800 }