Linux block layer
 help / color / mirror / Atom feed
From: Triet Hoang <triet.hoang.dev@gmail.com>
To: axboe@kernel.dk
Cc: dbgh9129@gmail.com, triet.hoang.dev@gmail.com,
	mateusz.nowicki@posteo.net, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] mtip32xx: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Thu, 20 Aug 2026 11:30:33 +0700	[thread overview]
Message-ID: <20260820043033.1945613-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 its suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.

Fixes: cd97b7e0d780 ("mtip32xx: convert to generic power management")

Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
 drivers/block/mtip32xx/mtip32xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index f214a616386c..cf44e281d7b3 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3937,7 +3937,7 @@ static void mtip_pci_remove(struct pci_dev *pdev)
  *	0  Success
  *	<0 Error
  */
-static int __maybe_unused mtip_pci_suspend(struct device *dev)
+static int mtip_pci_suspend(struct device *dev)
 {
 	int rv = 0;
 	struct driver_data *dd = dev_get_drvdata(dev);
@@ -3959,7 +3959,7 @@ static int __maybe_unused mtip_pci_suspend(struct device *dev)
  *      0  Success
  *      <0 Error
  */
-static int __maybe_unused mtip_pci_resume(struct device *dev)
+static int mtip_pci_resume(struct device *dev)
 {
 	int rv = 0;
 	struct driver_data *dd = dev_get_drvdata(dev);
@@ -4002,7 +4002,7 @@ static const struct pci_device_id mtip_pci_tbl[] = {
 	{ 0 }
 };
 
-static SIMPLE_DEV_PM_OPS(mtip_pci_pm_ops, mtip_pci_suspend, mtip_pci_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mtip_pci_pm_ops, mtip_pci_suspend, mtip_pci_resume);
 
 /* Structure that describes the PCI driver functions. */
 static struct pci_driver mtip_pci_driver = {
@@ -4010,7 +4010,7 @@ static struct pci_driver mtip_pci_driver = {
 	.id_table		= mtip_pci_tbl,
 	.probe			= mtip_pci_probe,
 	.remove			= mtip_pci_remove,
-	.driver.pm		= &mtip_pci_pm_ops,
+	.driver.pm		= pm_sleep_ptr(&mtip_pci_pm_ops),
 	.shutdown		= mtip_pci_shutdown,
 };
 
-- 
2.53.0


                 reply	other threads:[~2026-08-20  4:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260820043033.1945613-1-triet.hoang.dev@gmail.com \
    --to=triet.hoang.dev@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=dbgh9129@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mateusz.nowicki@posteo.net \
    /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