hwrng: exynos - switch to DEFINE_SIMPLE_DEV_PM_OPS
authorMartin Kaiser <martin@kaiser.cx>
Tue, 4 Jul 2023 17:10:51 +0000 (19:10 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Jul 2023 10:16:24 +0000 (22:16 +1200)
SIMPLE_DEV_PM_OPS is deprecated, replace it with DEFINE_SIMPLE_DEV_PM_OPS
and use pm_sleep_ptr for setting the driver's pm routines. We can now
remove the __maybe_unused qualifier in the suspend and resume functions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/exynos-trng.c

index 9cc3d542dd0f4f7f8c5d55b2039a3d73d8669cf6..30207b7ac5f4c5343b327eccff794c23251e30c0 100644 (file)
@@ -185,14 +185,14 @@ static int exynos_trng_remove(struct platform_device *pdev)
        return 0;
 }
 
-static int __maybe_unused exynos_trng_suspend(struct device *dev)
+static int exynos_trng_suspend(struct device *dev)
 {
        pm_runtime_put_sync(dev);
 
        return 0;
 }
 
-static int __maybe_unused exynos_trng_resume(struct device *dev)
+static int exynos_trng_resume(struct device *dev)
 {
        int ret;
 
@@ -205,7 +205,7 @@ static int __maybe_unused exynos_trng_resume(struct device *dev)
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(exynos_trng_pm_ops, exynos_trng_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(exynos_trng_pm_ops, exynos_trng_suspend,
                         exynos_trng_resume);
 
 static const struct of_device_id exynos_trng_dt_match[] = {
@@ -219,7 +219,7 @@ MODULE_DEVICE_TABLE(of, exynos_trng_dt_match);
 static struct platform_driver exynos_trng_driver = {
        .driver = {
                .name = "exynos-trng",
-               .pm = &exynos_trng_pm_ops,
+               .pm = pm_sleep_ptr(&exynos_trng_pm_ops),
                .of_match_table = exynos_trng_dt_match,
        },
        .probe = exynos_trng_probe,