From: Jisheng Zhang <jszhang@kernel.org>
To: "Mark Brown" <broonie@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Radu Pirea" <radu_nicolae.pirea@upb.ro>,
"Vladimir Moravcevic" <vmoravcevic@axiado.com>,
"Tzu-Hao Wei" <twei@axiado.com>, "Swark Yang" <syang@axiado.com>,
"Prasad Bolisetty" <pbolisetty@axiado.com>,
"Kamal Dasu" <kamal.dasu@broadcom.com>,
"William Zhang" <william.zhang@broadcom.com>,
"Kursad Oney" <kursad.oney@broadcom.com>,
"Jonas Gorski" <jonas.gorski@gmail.com>,
"Anand Gore" <anand.gore@broadcom.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Vladimir Oltean" <olteanv@gmail.com>,
"Frank Li" <Frank.Li@nxp.com>, "Ray Jui" <rjui@broadcom.com>,
"Scott Branden" <sbranden@broadcom.com>,
"Yinbo Zhu" <zhuyinbo@loongson.cn>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Kevin Hilman" <khilman@baylibre.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Linus Walleij" <linusw@kernel.org>,
"Heiko Stuebner" <heiko@sntech.de>,
"Andi Shyti" <andi.shyti@kernel.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Orson Zhai" <orsonzhai@gmail.com>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Chunyan Zhang" <zhang.lyra@gmail.com>,
"Li-hao Kuo" <lhjeff911@gmail.com>,
"Masahisa Kojima" <kojima.masahisa@socionext.com>,
"Jassi Brar" <jassisinghbrar@gmail.com>,
"Laxman Dewangan" <ldewangan@nvidia.com>,
"Thierry Reding" <thierry.reding@kernel.org>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Sowjanya Komatineni" <skomatineni@nvidia.com>,
"Michal Simek" <michal.simek@amd.com>
Cc: bcm-kernel-feedback-list@broadcom.com, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 10/39] spi: dln2: use modern PM macros
Date: Mon, 3 Aug 2026 22:19:34 +0800 [thread overview]
Message-ID: <20260803142003.12857-11-jszhang@kernel.org> (raw)
In-Reply-To: <20260803142003.12857-1-jszhang@kernel.org>
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/spi/spi-dln2.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c
index 8333dda7d1e8..60085ed04a06 100644
--- a/drivers/spi/spi-dln2.c
+++ b/drivers/spi/spi-dln2.c
@@ -787,7 +787,6 @@ static void dln2_spi_remove(struct platform_device *pdev)
dev_err(&pdev->dev, "Failed to disable SPI module\n");
}
-#ifdef CONFIG_PM_SLEEP
static int dln2_spi_suspend(struct device *dev)
{
int ret;
@@ -834,9 +833,7 @@ static int dln2_spi_resume(struct device *dev)
return spi_controller_resume(host);
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
static int dln2_spi_runtime_suspend(struct device *dev)
{
struct spi_controller *host = dev_get_drvdata(dev);
@@ -852,18 +849,16 @@ static int dln2_spi_runtime_resume(struct device *dev)
return dln2_spi_enable(dln2, true);
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops dln2_spi_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)
- SET_RUNTIME_PM_OPS(dln2_spi_runtime_suspend,
- dln2_spi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)
+ RUNTIME_PM_OPS(dln2_spi_runtime_suspend, dln2_spi_runtime_resume, NULL)
};
static struct platform_driver spi_dln2_driver = {
.driver = {
.name = "dln2-spi",
- .pm = &dln2_spi_pm,
+ .pm = pm_ptr(&dln2_spi_pm),
},
.probe = dln2_spi_probe,
.remove = dln2_spi_remove,
--
2.53.0
next prev parent reply other threads:[~2026-08-03 14:41 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 14:19 [PATCH 00/39] spi: use modern PM macros Jisheng Zhang
2026-08-03 14:19 ` [PATCH 01/39] spi: atmel-quadspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 02/39] spi: amlogic-spifc-a1: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 03/39] spi: at91-usart: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 04/39] spi: axiado: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 05/39] spi: bcm-qspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 06/39] spi: bcm63xx-hsspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 07/39] spi: bcmbca-hsspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 08/39] spi: cadence: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 09/39] spi: coldfire-qspi: " Jisheng Zhang
2026-08-03 14:19 ` Jisheng Zhang [this message]
2026-08-03 14:19 ` [PATCH 11/39] spi: dw-pci: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 12/39] spi: spi-fsl-dspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 13/39] spi: fsl-espi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 14/39] spi: fsl-lpspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 15/39] spi: qcom-geni: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 16/39] spi: img-spfi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 17/39] spi: loongson: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 18/39] spi: meson-spifc: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 19/39] spi: mt65xx: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 20/39] spi: mtk-nor: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 21/39] spi: mxic: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 22/39] spi: omap2-mcspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 23/39] spi: orion: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 24/39] spi: pl022: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 25/39] spi: spi-qcom-qspi: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 26/39] spi: qup: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 27/39] spi: rockchip-sfc: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 28/39] spi: rockchip: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 29/39] spi: s3c64xx: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 30/39] spi: slave-mt27xx: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 31/39] spi: sprd: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 32/39] spi: sunplus-sp7021: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 33/39] spi: syncuacer: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 34/39] spi: tegra114: " Jisheng Zhang
2026-08-03 14:19 ` [PATCH 35/39] spi: tegra20-sflash: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 36/39] spi: tegra20-slink: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 37/39] spi: tegra210-quad: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 38/39] spi: topcliff-pch: " Jisheng Zhang
2026-08-03 14:20 ` [PATCH 39/39] spi: zynqmp-gqspi: " Jisheng Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260803142003.12857-11-jszhang@kernel.org \
--to=jszhang@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alim.akhtar@samsung.com \
--cc=anand.gore@broadcom.com \
--cc=andi.shyti@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=broonie@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=florian.fainelli@broadcom.com \
--cc=heiko@sntech.de \
--cc=jassisinghbrar@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=jonas.gorski@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kamal.dasu@broadcom.com \
--cc=khilman@baylibre.com \
--cc=kojima.masahisa@socionext.com \
--cc=krzk@kernel.org \
--cc=kursad.oney@broadcom.com \
--cc=ldewangan@nvidia.com \
--cc=lhjeff911@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=matthias.bgg@gmail.com \
--cc=michal.simek@amd.com \
--cc=neil.armstrong@linaro.org \
--cc=nicolas.ferre@microchip.com \
--cc=olteanv@gmail.com \
--cc=orsonzhai@gmail.com \
--cc=pbolisetty@axiado.com \
--cc=radu_nicolae.pirea@upb.ro \
--cc=rafal@milecki.pl \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=skomatineni@nvidia.com \
--cc=syang@axiado.com \
--cc=thierry.reding@kernel.org \
--cc=tudor.ambarus@linaro.org \
--cc=twei@axiado.com \
--cc=vmoravcevic@axiado.com \
--cc=william.zhang@broadcom.com \
--cc=zhang.lyra@gmail.com \
--cc=zhuyinbo@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox