[PATCH] memory: pl353: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

Triet Hoang <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel
Message-ID <[email protected]>
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,
also reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.

Signed-off-by: Triet Hoang <[email protected]>
---
 drivers/memory/pl353-smc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/memory/pl353-smc.c b/drivers/memory/pl353-smc.c
index 28a8cc56003c..047e42c8715a 100644
--- a/drivers/memory/pl353-smc.c
+++ b/drivers/memory/pl353-smc.c
@@ -25,7 +25,7 @@ struct pl353_smc_data {
 	struct clk		*aclk;
 };
 
-static int __maybe_unused pl353_smc_suspend(struct device *dev)
+static int pl353_smc_suspend(struct device *dev)
 {
 	struct pl353_smc_data *pl353_smc = dev_get_drvdata(dev);
 
@@ -35,7 +35,7 @@ static int __maybe_unused pl353_smc_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused pl353_smc_resume(struct device *dev)
+static int pl353_smc_resume(struct device *dev)
 {
 	struct pl353_smc_data *pl353_smc = dev_get_drvdata(dev);
 	int ret;
@@ -56,7 +56,7 @@ static int __maybe_unused pl353_smc_resume(struct device *dev)
 	return ret;
 }
 
-static SIMPLE_DEV_PM_OPS(pl353_smc_dev_pm_ops, pl353_smc_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(pl353_smc_dev_pm_ops, pl353_smc_suspend,
 			 pl353_smc_resume);
 
 static const struct of_device_id pl353_smc_supported_children[] = {
@@ -121,7 +121,7 @@ MODULE_DEVICE_TABLE(amba, pl353_ids);
 static struct amba_driver pl353_smc_driver = {
 	.drv = {
 		.name = "pl353-smc",
-		.pm = &pl353_smc_dev_pm_ops,
+		.pm = pm_sleep_ptr(&pl353_smc_dev_pm_ops),
 	},
 	.id_table = pl353_ids,
 	.probe = pl353_smc_probe,
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.