The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-25  8:27 Triet Hoang
  2026-08-25 20:13 ` kernel test robot
  2026-08-26  2:14 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Triet Hoang @ 2026-08-25  8:27 UTC (permalink / raw)
  To: Maxim Levitsky
  Cc: Alex Dubov, Ulf Hansson, linux-mmc, linux-kernel, Triet Hoang

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2026-08-25  8:27 [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
@ 2026-08-25 20:13 ` kernel test robot
  2026-08-26  2:14 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-08-25 20:13 UTC (permalink / raw)
  To: Triet Hoang, Maxim Levitsky
  Cc: oe-kbuild-all, Alex Dubov, Ulf Hansson, linux-mmc, linux-kernel,
	Triet Hoang

Hi Triet,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v7.2 next-20260824]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Triet-Hoang/memstick-Convert-to-DEFINE_SIMPLE_DEV_PM_OPS/20260825-152717
base:   linus/master
patch link:    https://lore.kernel.org/r/20260825082718.244949-1-triet.hoang.dev%40gmail.com
patch subject: [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
config: csky-allmodconfig (https://download.01.org/0day-ci/archive/20260826/202608260448.DBZikir0-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260826/202608260448.DBZikir0-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608260448.DBZikir0-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/memstick/host/r592.c: In function 'r592_suspend':
>> drivers/memstick/host/r592.c:854:9: error: implicit declaration of function 'r592_clear_interrupts' [-Wimplicit-function-declaration]
     854 |         r592_clear_interrupts(dev);
         |         ^~~~~~~~~~~~~~~~~~~~~


vim +/r592_clear_interrupts +854 drivers/memstick/host/r592.c

9263412501022fe Maxim Levitsky  2011-03-25  849  
9263412501022fe Maxim Levitsky  2011-03-25  850  static int r592_suspend(struct device *core_dev)
9263412501022fe Maxim Levitsky  2011-03-25  851  {
deaa53989537c62 Chuhong Yuan    2019-07-23  852  	struct r592_device *dev = dev_get_drvdata(core_dev);
9263412501022fe Maxim Levitsky  2011-03-25  853  
9263412501022fe Maxim Levitsky  2011-03-25 @854  	r592_clear_interrupts(dev);
9263412501022fe Maxim Levitsky  2011-03-25  855  	memstick_suspend_host(dev->host);
8fa7292fee5c524 Thomas Gleixner 2025-04-05  856  	timer_delete_sync(&dev->detect_timer);
9263412501022fe Maxim Levitsky  2011-03-25  857  	return 0;
9263412501022fe Maxim Levitsky  2011-03-25  858  }
9263412501022fe Maxim Levitsky  2011-03-25  859  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2026-08-25  8:27 [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
  2026-08-25 20:13 ` kernel test robot
@ 2026-08-26  2:14 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-08-26  2:14 UTC (permalink / raw)
  To: Triet Hoang, Maxim Levitsky
  Cc: llvm, oe-kbuild-all, Alex Dubov, Ulf Hansson, linux-mmc,
	linux-kernel, Triet Hoang

Hi Triet,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v7.2 next-20260824]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Triet-Hoang/memstick-Convert-to-DEFINE_SIMPLE_DEV_PM_OPS/20260825-152717
base:   linus/master
patch link:    https://lore.kernel.org/r/20260825082718.244949-1-triet.hoang.dev%40gmail.com
patch subject: [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
config: riscv-randconfig-002-20260826 (https://download.01.org/0day-ci/archive/20260826/202608260945.vNkJPYxr-lkp@intel.com/config)
compiler: clang version 21.1.8 (https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260826/202608260945.vNkJPYxr-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608260945.vNkJPYxr-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/memstick/host/r592.c:854:2: error: call to undeclared function 'r592_clear_interrupts'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     854 |         r592_clear_interrupts(dev);
         |         ^
   drivers/memstick/host/r592.c:864:2: error: call to undeclared function 'r592_clear_interrupts'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     864 |         r592_clear_interrupts(dev);
         |         ^
   2 errors generated.


vim +/r592_clear_interrupts +854 drivers/memstick/host/r592.c

9263412501022fe Maxim Levitsky  2011-03-25  849  
9263412501022fe Maxim Levitsky  2011-03-25  850  static int r592_suspend(struct device *core_dev)
9263412501022fe Maxim Levitsky  2011-03-25  851  {
deaa53989537c62 Chuhong Yuan    2019-07-23  852  	struct r592_device *dev = dev_get_drvdata(core_dev);
9263412501022fe Maxim Levitsky  2011-03-25  853  
9263412501022fe Maxim Levitsky  2011-03-25 @854  	r592_clear_interrupts(dev);
9263412501022fe Maxim Levitsky  2011-03-25  855  	memstick_suspend_host(dev->host);
8fa7292fee5c524 Thomas Gleixner 2025-04-05  856  	timer_delete_sync(&dev->detect_timer);
9263412501022fe Maxim Levitsky  2011-03-25  857  	return 0;
9263412501022fe Maxim Levitsky  2011-03-25  858  }
9263412501022fe Maxim Levitsky  2011-03-25  859  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-26  2:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25  8:27 [PATCH] memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-25 20:13 ` kernel test robot
2026-08-26  2:14 ` kernel test robot

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