]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: atmel-quadspi: Undo runtime PM changes at driver exit time
authorJinjie Ruan <ruanjinjie@huawei.com>
Fri, 6 Sep 2024 02:39:56 +0000 (10:39 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 19 Sep 2024 10:51:19 +0000 (12:51 +0200)
It's important to undo pm_runtime_use_autosuspend() with
pm_runtime_dont_use_autosuspend() at driver exit time unless driver
initially enabled pm_runtime with devm_pm_runtime_enable()
(which handles it for you).

Hence, call pm_runtime_dont_use_autosuspend() at driver exit time
to fix it.

Fixes: 4a2f83b7f780 ("spi: atmel-quadspi: add runtime pm support")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20240906023956.1004440-1-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/atmel-quadspi.c

index 936d578694931a61b96d559a0a7b040e1a9eff8b..9b7aeef6ce99907cd2cc92244a2761b25f1f08b4 100644 (file)
@@ -721,6 +721,7 @@ static void atmel_qspi_remove(struct platform_device *pdev)
        clk_unprepare(aq->pclk);
 
        pm_runtime_disable(&pdev->dev);
+       pm_runtime_dont_use_autosuspend(&pdev->dev);
        pm_runtime_put_noidle(&pdev->dev);
 }