mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul.cercueil@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Paul Cercueil <paul.cercueil@bootlin.com>,
	Maxim Levitsky <maximlevitsky@gmail.com>
Subject: [PATCH 11/12] mtd: rawnand: r852: Remove #ifdef guards for PM related functions
Date: Thu,  5 Nov 2026 18:11:57 +0100	[thread overview]
Message-ID: <20261105171158.399247-12-paul.cercueil@bootlin.com> (raw)
In-Reply-To: <20261105171158.399247-1-paul.cercueil@bootlin.com>

Use the new 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: Paul Cercueil <paul.cercueil@bootlin.com>
---
Cc: Maxim Levitsky <maximlevitsky@gmail.com>

 drivers/mtd/nand/raw/r852.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c
index 92c47d351c27..c145eb8ac29d 100644
--- a/drivers/mtd/nand/raw/r852.c
+++ b/drivers/mtd/nand/raw/r852.c
@@ -1013,7 +1013,6 @@ static void r852_shutdown(struct pci_dev *pci_dev)
 	pci_disable_device(pci_dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int r852_suspend(struct device *device)
 {
 	struct r852_device *dev = dev_get_drvdata(device);
@@ -1066,7 +1065,6 @@ static int r852_resume(struct device *device)
 	r852_update_card_detect(dev);
 	return 0;
 }
-#endif
 
 static const struct pci_device_id r852_pci_id_tbl[] = {
 
@@ -1076,7 +1074,7 @@ static const struct pci_device_id r852_pci_id_tbl[] = {
 
 MODULE_DEVICE_TABLE(pci, r852_pci_id_tbl);
 
-static SIMPLE_DEV_PM_OPS(r852_pm_ops, r852_suspend, r852_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(r852_pm_ops, r852_suspend, r852_resume);
 
 static struct pci_driver r852_pci_driver = {
 	.name		= DRV_NAME,
@@ -1084,7 +1082,7 @@ static struct pci_driver r852_pci_driver = {
 	.probe		= r852_probe,
 	.remove		= r852_remove,
 	.shutdown	= r852_shutdown,
-	.driver.pm	= &r852_pm_ops,
+	.driver.pm	= pm_sleep_ptr(&r852_pm_ops),
 };
 
 module_pci_driver(r852_pci_driver);
-- 
2.47.3


  parent reply	other threads:[~2026-11-05 17:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 17:11 [PATCH 00/12] mtd: Remove #ifdef guards for PM related Paul Cercueil
2026-11-05 17:11 ` [PATCH 01/12] mtd: Remove #ifdef guards for PM related functions Paul Cercueil
2026-11-05 17:11 ` [PATCH 02/12] mtd: rawnand: vf610: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 03/12] mtd: spear_smi: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 04/12] mtd: physmap: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 05/12] mtd: maps: pxa2xx: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 06/12] mtd: nand: mtk: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 07/12] mtd: rawnand: fsmc: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 08/12] mtd: rawnand: hisi504: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 09/12] mtd: rawnand: mtk: " Paul Cercueil
2026-11-05 17:11 ` [PATCH 10/12] mtd: rawnand: omap_elm: " Paul Cercueil
2026-11-05 17:11 ` Paul Cercueil [this message]
2026-11-05 17:11 ` [PATCH 12/12] mtd: rawnand: txx9ndfmc: " Paul Cercueil

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=20261105171158.399247-12-paul.cercueil@bootlin.com \
    --to=paul.cercueil@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=maximlevitsky@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.com \
    /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

all inboxes | Powered by JetHome®