]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
hwrng: exynos - Disable runtime PM on driver unbind
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Mon, 14 Mar 2016 00:07:15 +0000 (09:07 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2020 08:26:32 +0000 (10:26 +0200)
commit 27d80fa8bccf8d28bef4f89709638efc624fef9a upstream.

Driver enabled runtime PM but did not revert this on removal. Re-binding
of a device triggered warning:
exynos-rng 10830400.rng: Unbalanced pm_runtime_enable!

Fixes: b329669ea0b5 ("hwrng: exynos - Add support for Exynos random number generator")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/hw_random/exynos-rng.c

index 7ba0ae060d6138db41c29fd2c7b894e9144de72e..66115ef979b150dc90b456db1ac868766d095f78 100644 (file)
@@ -155,6 +155,14 @@ static int exynos_rng_probe(struct platform_device *pdev)
        return ret;
 }
 
+static int exynos_rng_remove(struct platform_device *pdev)
+{
+       pm_runtime_dont_use_autosuspend(&pdev->dev);
+       pm_runtime_disable(&pdev->dev);
+
+       return 0;
+}
+
 static int __maybe_unused exynos_rng_runtime_suspend(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
@@ -212,6 +220,7 @@ static struct platform_driver exynos_rng_driver = {
                .of_match_table = exynos_rng_dt_match,
        },
        .probe          = exynos_rng_probe,
+       .remove         = exynos_rng_remove,
 };
 
 module_platform_driver(exynos_rng_driver);