Linux block layer
 help / color / mirror / Atom feed
* [PATCH] mtip32xx: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20  4:30 Triet Hoang
  0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20  4:30 UTC (permalink / raw)
  To: axboe; +Cc: dbgh9129, triet.hoang.dev, mateusz.nowicki, linux-block,
	linux-kernel

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-20  4:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  4:30 [PATCH] mtip32xx: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox