The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] omap-rng: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20  4:51 Triet Hoang
  0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20  4:51 UTC (permalink / raw)
  To: dsaxena; +Cc: olivia, herbert, linux-crypto, linux-kernel, Triet Hoang

Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().

This lets us drop the __maybe_unused annotations from its suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.

Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
 drivers/char/hw_random/omap-rng.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 9f0545c67774..22cde35ebe5d 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -530,7 +530,7 @@ static void omap_rng_remove(struct platform_device *pdev)
 	clk_disable_unprepare(priv->clk_reg);
 }
 
-static int __maybe_unused omap_rng_suspend(struct device *dev)
+static int omap_rng_suspend(struct device *dev)
 {
 	struct omap_rng_dev *priv = dev_get_drvdata(dev);
 
@@ -540,7 +540,7 @@ static int __maybe_unused omap_rng_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused omap_rng_resume(struct device *dev)
+static int omap_rng_resume(struct device *dev)
 {
 	struct omap_rng_dev *priv = dev_get_drvdata(dev);
 	int ret;
@@ -556,12 +556,12 @@ static int __maybe_unused omap_rng_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
 
 static struct platform_driver omap_rng_driver = {
 	.driver = {
 		.name		= "omap_rng",
-		.pm		= &omap_rng_pm,
+		.pm		= pm_sleep_ptr(&omap_rng_pm),
 		.of_match_table = of_match_ptr(omap_rng_of_match),
 	},
 	.probe		= omap_rng_probe,
-- 
2.53.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-20  4:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  4:51 [PATCH] omap-rng: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox