lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260106-spi_st_maybe_unused_removal-v1-2-8f5ca7136e96@foss.st.com>
Date: Tue, 6 Jan 2026 13:14:18 +0100
From: Alain Volmat <alain.volmat@...s.st.com>
To: Mark Brown <broonie@...nel.org>,
        Maxime Coquelin
	<mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>
CC: <linux-spi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        Alain Volmat
	<alain.volmat@...s.st.com>
Subject: [PATCH 2/4] drivers: spi: stm32-ospi: avoid __maybe_unused and use
 pm_ptr

Switch to usage of pm_ptr / SYSTEM_SLEEP_PM_OPS / RUNTIME_PM_OPS
in order to avoid having to mark the pm related functions as
__maybe_unused.

Signed-off-by: Alain Volmat <alain.volmat@...s.st.com>
---
 drivers/spi/spi-stm32-ospi.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c
index f396439e2281..58d8cec74c7b 100644
--- a/drivers/spi/spi-stm32-ospi.c
+++ b/drivers/spi/spi-stm32-ospi.c
@@ -1012,7 +1012,7 @@ static void stm32_ospi_remove(struct platform_device *pdev)
 	pm_runtime_force_suspend(ospi->dev);
 }
 
-static int __maybe_unused stm32_ospi_suspend(struct device *dev)
+static int stm32_ospi_suspend(struct device *dev)
 {
 	struct stm32_ospi *ospi = dev_get_drvdata(dev);
 
@@ -1023,7 +1023,7 @@ static int __maybe_unused stm32_ospi_suspend(struct device *dev)
 	return pm_runtime_force_suspend(ospi->dev);
 }
 
-static int __maybe_unused stm32_ospi_resume(struct device *dev)
+static int stm32_ospi_resume(struct device *dev)
 {
 	struct stm32_ospi *ospi = dev_get_drvdata(dev);
 	void __iomem *regs_base = ospi->regs_base;
@@ -1052,7 +1052,7 @@ static int __maybe_unused stm32_ospi_resume(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused stm32_ospi_runtime_suspend(struct device *dev)
+static int stm32_ospi_runtime_suspend(struct device *dev)
 {
 	struct stm32_ospi *ospi = dev_get_drvdata(dev);
 
@@ -1061,7 +1061,7 @@ static int __maybe_unused stm32_ospi_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused stm32_ospi_runtime_resume(struct device *dev)
+static int stm32_ospi_runtime_resume(struct device *dev)
 {
 	struct stm32_ospi *ospi = dev_get_drvdata(dev);
 
@@ -1069,9 +1069,8 @@ static int __maybe_unused stm32_ospi_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops stm32_ospi_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(stm32_ospi_suspend, stm32_ospi_resume)
-	SET_RUNTIME_PM_OPS(stm32_ospi_runtime_suspend,
-			   stm32_ospi_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(stm32_ospi_suspend, stm32_ospi_resume)
+	RUNTIME_PM_OPS(stm32_ospi_runtime_suspend, stm32_ospi_runtime_resume, NULL)
 };
 
 static const struct of_device_id stm32_ospi_of_match[] = {
@@ -1085,7 +1084,7 @@ static struct platform_driver stm32_ospi_driver = {
 	.remove	= stm32_ospi_remove,
 	.driver	= {
 		.name = "stm32-ospi",
-		.pm = &stm32_ospi_pm_ops,
+		.pm = pm_ptr(&stm32_ospi_pm_ops),
 		.of_match_table = stm32_ospi_of_match,
 	},
 };

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ