The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Triet Hoang <triet.hoang.dev@gmail.com>
To: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>, Ulf Hansson <ulfh@kernel.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Triet Hoang <triet.hoang.dev@gmail.com>
Subject: [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Tue, 25 Aug 2026 15:27:17 +0700	[thread overview]
Message-ID: <20260825082718.244949-1-triet.hoang.dev@gmail.com> (raw)

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 the suspend
and resume callbacks, also reduces kernel size in case CONFIG_PM
or CONFIG_PM_SLEEP is disabled.

Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
 drivers/memstick/host/jmb38x_ms.c | 8 ++++----
 drivers/memstick/host/r592.c      | 6 ++----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
index d93ba5e8662c..2f5f0e0677f5 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -792,7 +792,7 @@ static int jmb38x_ms_pmos(struct pci_dev *pdev, int flag)
         return 0;
 }
 
-static int __maybe_unused jmb38x_ms_suspend(struct device *dev)
+static int jmb38x_ms_suspend(struct device *dev)
 {
 	struct jmb38x_ms *jm = dev_get_drvdata(dev);
 
@@ -809,7 +809,7 @@ static int __maybe_unused jmb38x_ms_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused jmb38x_ms_resume(struct device *dev)
+static int jmb38x_ms_resume(struct device *dev)
 {
 	struct jmb38x_ms *jm = dev_get_drvdata(dev);
 	int rc;
@@ -1011,14 +1011,14 @@ static struct pci_device_id jmb38x_ms_id_tbl [] = {
 	{ }
 };
 
-static SIMPLE_DEV_PM_OPS(jmb38x_ms_pm_ops, jmb38x_ms_suspend, jmb38x_ms_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(jmb38x_ms_pm_ops, jmb38x_ms_suspend, jmb38x_ms_resume);
 
 static struct pci_driver jmb38x_ms_driver = {
 	.name = DRIVER_NAME,
 	.id_table = jmb38x_ms_id_tbl,
 	.probe = jmb38x_ms_probe,
 	.remove = jmb38x_ms_remove,
-	.driver.pm = &jmb38x_ms_pm_ops,
+	.driver.pm = pm_sleep_ptr(&jmb38x_ms_pm_ops),
 };
 
 module_pci_driver(jmb38x_ms_driver);
diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c
index 605b2265536f..ba7d63eb5b31 100644
--- a/drivers/memstick/host/r592.c
+++ b/drivers/memstick/host/r592.c
@@ -847,7 +847,6 @@ static void r592_remove(struct pci_dev *pdev)
 	memstick_free_host(dev->host);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int r592_suspend(struct device *core_dev)
 {
 	struct r592_device *dev = dev_get_drvdata(core_dev);
@@ -868,9 +867,8 @@ static int r592_resume(struct device *core_dev)
 	r592_update_card_detect(dev);
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(r592_pm_ops, r592_suspend, r592_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(r592_pm_ops, r592_suspend, r592_resume);
 
 MODULE_DEVICE_TABLE(pci, r592_pci_id_tbl);
 
@@ -879,7 +877,7 @@ static struct pci_driver r592_pci_driver = {
 	.id_table	= r592_pci_id_tbl,
 	.probe		= r592_probe,
 	.remove		= r592_remove,
-	.driver.pm	= &r592_pm_ops,
+	.driver.pm	= pm_sleep_ptr(&r592_pm_ops),
 };
 
 module_pci_driver(r592_pci_driver);
-- 
2.53.0


             reply	other threads:[~2026-08-25  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  8:27 Triet Hoang [this message]
2026-08-25 20:13 ` [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS() kernel test robot
2026-08-26  2:14 ` kernel test robot

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=20260825082718.244949-1-triet.hoang.dev@gmail.com \
    --to=triet.hoang.dev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=maximlevitsky@gmail.com \
    --cc=oakad@yahoo.com \
    --cc=ulfh@kernel.org \
    /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