memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Subsystems (3)
PATCH 1/1 memstick: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
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.
--- drivers/memstick/host/jmb38x_ms.c | 8 ++++---- drivers/memstick/host/r592.c | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-)
drivers/memstick/host/jmb38x_ms.c +4 -4
@@ -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);
drivers/memstick/host/r592.c +2 -4
@@ -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);
Signature · 1 line
2.53.0
kernel test robot
build botkernel test robot noticed the following build errors:
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/[email protected]/config) compiler: csky-linux-gcc (GCC) 16.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260826/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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
kernel test robot
build botkernel test robot noticed the following build errors:
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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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