* [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
@ 2026-09-08 1:46 Li Jun
2026-09-09 15:16 ` Rafael J. Wysocki (Intel)
2026-09-10 0:54 ` kernel test robot
0 siblings, 2 replies; 3+ messages in thread
From: Li Jun @ 2026-09-08 1:46 UTC (permalink / raw)
To: lijun01, rafael, lenb, linux-acpi
Replace `#ifdef CONFIG_PM_SLEEP` boilerplate with the modern
`DEFINE_SIMPLE_DEV_PM_OPS()` macro in the acpi_button driver.
Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
drivers/acpi/button.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index cdbb1023a8ee..15fc5d2ae467 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -161,14 +161,10 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
static int acpi_button_probe(struct platform_device *pdev);
static void acpi_button_remove(struct platform_device *pdev);
-#ifdef CONFIG_PM_SLEEP
static int acpi_button_suspend(struct device *dev);
static int acpi_button_resume(struct device *dev);
-#else
-#define acpi_button_suspend NULL
-#define acpi_button_resume NULL
-#endif
-static SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
+
+static DEFINE_SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
static struct platform_driver acpi_button_driver = {
.probe = acpi_button_probe,
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
2026-09-08 1:46 [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS Li Jun
@ 2026-09-09 15:16 ` Rafael J. Wysocki (Intel)
2026-09-10 0:54 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-09-09 15:16 UTC (permalink / raw)
To: Li Jun; +Cc: rafael, lenb, linux-acpi
On Tue, Sep 8, 2026 at 3:47 AM Li Jun <lijun01@kylinos.cn> wrote:
>
> Replace `#ifdef CONFIG_PM_SLEEP` boilerplate with the modern
> `DEFINE_SIMPLE_DEV_PM_OPS()` macro in the acpi_button driver.
This is not a replacement, it just makes the code previously under the
#ifdef to be compiled and never used.
> Signed-off-by: Li Jun <lijun01@kylinos.cn>
> ---
> drivers/acpi/button.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
> index cdbb1023a8ee..15fc5d2ae467 100644
> --- a/drivers/acpi/button.c
> +++ b/drivers/acpi/button.c
> @@ -161,14 +161,10 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
> static int acpi_button_probe(struct platform_device *pdev);
> static void acpi_button_remove(struct platform_device *pdev);
>
> -#ifdef CONFIG_PM_SLEEP
> static int acpi_button_suspend(struct device *dev);
> static int acpi_button_resume(struct device *dev);
> -#else
> -#define acpi_button_suspend NULL
> -#define acpi_button_resume NULL
> -#endif
> -static SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
> +
> +static DEFINE_SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
Does this compile with CONFIG_PM_SLEEP unset?
Regardless, I don't see much point in making these changes TBH.
> static struct platform_driver acpi_button_driver = {
> .probe = acpi_button_probe,
> --
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
2026-09-08 1:46 [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS Li Jun
2026-09-09 15:16 ` Rafael J. Wysocki (Intel)
@ 2026-09-10 0:54 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-09-10 0:54 UTC (permalink / raw)
To: Li Jun, rafael, lenb, linux-acpi; +Cc: oe-kbuild-all
Hi Li,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on rafael-pm/bleeding-edge linus/master v7.3-rc2 next-20260909]
[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/Li-Jun/ACPI-button-replace-SIMPLE_DEV_PM_OPS-with-DEFINE_SIMPLE_DEV_PM_OPS/20260908-094645
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20260908014645.4165221-1-lijun01%40kylinos.cn
patch subject: [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS
config: i386-randconfig-061-20260910 (https://download.01.org/0day-ci/archive/20260910/202609100827.qM0GkvjX-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/202609100827.qM0GkvjX-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/202609100827.qM0GkvjX-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/acpi/button.c:164:12: warning: function 'acpi_button_suspend' has internal linkage but is not defined [-Wundefined-internal]
164 | static int acpi_button_suspend(struct device *dev);
| ^
drivers/acpi/button.c:167:49: note: used here
167 | static DEFINE_SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
| ^
>> drivers/acpi/button.c:165:12: warning: function 'acpi_button_resume' has internal linkage but is not defined [-Wundefined-internal]
165 | static int acpi_button_resume(struct device *dev);
| ^
drivers/acpi/button.c:167:70: note: used here
167 | static DEFINE_SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume);
| ^
2 warnings generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_SOC_SDCA_HID
Depends on [n]: SOUND [=y] && SND [=m] && SND_SOC [=m] && SND_SOC_SDCA [=m] && (HID [=n]=y [=y] || HID [=n]=SND_SOC_SDCA [=m])
Selected by [m]:
- SND_SOC_RT766_SDCA_SDW [=m] && SOUND [=y] && SND [=m] && SND_SOC [=m] && SOUNDWIRE [=m] && SND_SOC_SDCA [=m]
vim +/acpi_button_suspend +164 drivers/acpi/button.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 163
e71eeb2a6bcc62 Rafael J. Wysocki 2014-07-23 @164 static int acpi_button_suspend(struct device *dev);
1be532de834ab7 Rafael J. Wysocki 2012-06-27 @165 static int acpi_button_resume(struct device *dev);
d02d5d6f0a061f Li Jun 2026-09-08 166
--
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-09-10 0:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 1:46 [PATCH] ACPI: button: replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS Li Jun
2026-09-09 15:16 ` Rafael J. Wysocki (Intel)
2026-09-10 0:54 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.