On Thu, 20 May 2021 19:53:13 +0800 Tian Tao tiantao6@hisilicon.com wrote:
Found using coccicheck script under review at: https://lore.kernel.org/lkml/20210427141946.2478411-1-Julia.Lawall@inria.fr/
Signed-off-by: Tian Tao tiantao6@hisilicon.com
There is an unbalanced pm_runtime_put_sync() in the remove in this driver I think. At least I can find the paired get. It's not a bug, because pm_runtime won't decrement the counter if already zero, but it's not pretty.
Might be something subtle in SPI framework that needs that though....
drivers/spi/spi-ti-qspi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index e06aafe..e6e8b06 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -172,9 +172,8 @@ static int ti_qspi_setup(struct spi_device *spi) dev_dbg(qspi->dev, "hz: %d, clock divider %d\n", qspi->spi_max_frequency, clk_div);
- ret = pm_runtime_get_sync(qspi->dev);
- ret = pm_runtime_resume_and_get(qspi->dev); if (ret < 0) {
dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); return ret; }pm_runtime_put_noidle(qspi->dev);