[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250921112649.104516-2-biju.das.jz@bp.renesas.com>
Date: Sun, 21 Sep 2025 12:26:45 +0100
From: Biju Das <biju.das.jz@...renesas.com>
To: Mark Brown <broonie@...nel.org>
Cc: Biju Das <biju.das.jz@...renesas.com>,
linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
Biju Das <biju.das.au@...il.com>,
linux-renesas-soc@...r.kernel.org
Subject: [PATCH 1/2] spi: rpc-if: Drop deprecated SIMPLE_DEV_PM_OPS
Replace SIMPLE_DEV_PM_OPS->DEFINE_SIMPLE_DEV_PM_OPS macro and use
pm_sleep_ptr(). This lets us drop the check for CONFIG_PM_SLEEP, and
reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled,
while increasing build coverage.
Also drop the __maybe_unused attribute from PM functions.
Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
---
drivers/spi/spi-rpc-if.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index 627cffea5d5c..a8e783cc66e7 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -196,21 +196,21 @@ static void rpcif_spi_remove(struct platform_device *pdev)
pm_runtime_disable(rpc->dev);
}
-static int __maybe_unused rpcif_spi_suspend(struct device *dev)
+static int rpcif_spi_suspend(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
return spi_controller_suspend(ctlr);
}
-static int __maybe_unused rpcif_spi_resume(struct device *dev)
+static int rpcif_spi_resume(struct device *dev)
{
struct spi_controller *ctlr = dev_get_drvdata(dev);
return spi_controller_resume(ctlr);
}
-static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
static const struct platform_device_id rpc_if_spi_id_table[] = {
{ .name = "rpc-if-spi" },
@@ -224,9 +224,7 @@ static struct platform_driver rpcif_spi_driver = {
.id_table = rpc_if_spi_id_table,
.driver = {
.name = "rpc-if-spi",
-#ifdef CONFIG_PM_SLEEP
- .pm = &rpcif_spi_pm_ops,
-#endif
+ .pm = pm_sleep_ptr(&rpcif_spi_pm_ops),
},
};
module_platform_driver(rpcif_spi_driver);
--
2.43.0
Powered by blists - more mailing lists