[PATCH 00/12] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*

Bastien Nocera posted 12 patches 3 weeks, 5 days ago
There is a newer version of this series
drivers/hid/hid-alps.c                     | 6 ++----
drivers/hid/hid-appletb-kbd.c              | 6 ++----
drivers/hid/hid-asus.c                     | 6 ++----
drivers/hid/hid-lenovo.c                   | 4 +---
drivers/hid/hid-logitech-dj.c              | 4 +---
drivers/hid/hid-nintendo.c                 | 7 ++-----
drivers/hid/hid-picolcd_core.c             | 8 +++-----
drivers/hid/hid-sensor-hub.c               | 8 +++-----
drivers/hid/hid-sony.c                     | 9 +++------
drivers/hid/hid-uclogic-core.c             | 6 ++----
drivers/hid/surface-hid/surface_hid.c      | 2 +-
drivers/hid/surface-hid/surface_hid_core.c | 5 -----
drivers/hid/surface-hid/surface_kbd.c      | 2 +-
drivers/hid/wacom_sys.c                    | 6 ++----
14 files changed, 25 insertions(+), 54 deletions(-)
[PATCH 00/12] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*
Posted by Bastien Nocera 3 weeks, 5 days ago
All those changes should be safe, as similar ones were done in other
subsystems, but I'm uncertain about the surface changes.

Bastien Nocera (12):
  HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: appletb-kbd: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: asus: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: lenovo: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: logitech-dj: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: picolcd_core: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: surface: Use pm_ptr_sleep instead of #ifdef CONFIG_PM_SLEEP

 drivers/hid/hid-alps.c                     | 6 ++----
 drivers/hid/hid-appletb-kbd.c              | 6 ++----
 drivers/hid/hid-asus.c                     | 6 ++----
 drivers/hid/hid-lenovo.c                   | 4 +---
 drivers/hid/hid-logitech-dj.c              | 4 +---
 drivers/hid/hid-nintendo.c                 | 7 ++-----
 drivers/hid/hid-picolcd_core.c             | 8 +++-----
 drivers/hid/hid-sensor-hub.c               | 8 +++-----
 drivers/hid/hid-sony.c                     | 9 +++------
 drivers/hid/hid-uclogic-core.c             | 6 ++----
 drivers/hid/surface-hid/surface_hid.c      | 2 +-
 drivers/hid/surface-hid/surface_hid_core.c | 5 -----
 drivers/hid/surface-hid/surface_kbd.c      | 2 +-
 drivers/hid/wacom_sys.c                    | 6 ++----
 14 files changed, 25 insertions(+), 54 deletions(-)

-- 
2.52.0
Re: [PATCH 00/12] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*
Posted by Jiri Kosina 3 weeks, 5 days ago
On Mon, 12 Jan 2026, Bastien Nocera wrote:

> All those changes should be safe, as similar ones were done in other
> subsystems, but I'm uncertain about the surface changes.
> 
> Bastien Nocera (12):
>   HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: appletb-kbd: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: asus: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: lenovo: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: logitech-dj: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: picolcd_core: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: surface: Use pm_ptr_sleep instead of #ifdef CONFIG_PM_SLEEP
> 
>  drivers/hid/hid-alps.c                     | 6 ++----
>  drivers/hid/hid-appletb-kbd.c              | 6 ++----
>  drivers/hid/hid-asus.c                     | 6 ++----
>  drivers/hid/hid-lenovo.c                   | 4 +---
>  drivers/hid/hid-logitech-dj.c              | 4 +---
>  drivers/hid/hid-nintendo.c                 | 7 ++-----
>  drivers/hid/hid-picolcd_core.c             | 8 +++-----
>  drivers/hid/hid-sensor-hub.c               | 8 +++-----
>  drivers/hid/hid-sony.c                     | 9 +++------
>  drivers/hid/hid-uclogic-core.c             | 6 ++----
>  drivers/hid/surface-hid/surface_hid.c      | 2 +-
>  drivers/hid/surface-hid/surface_hid_core.c | 5 -----
>  drivers/hid/surface-hid/surface_kbd.c      | 2 +-
>  drivers/hid/wacom_sys.c                    | 6 ++----
>  14 files changed, 25 insertions(+), 54 deletions(-)

Thanks Bastien, this is now in hid.git#for-6.20/pm_ptr.

-- 
Jiri Kosina
SUSE Labs
Re: [PATCH 00/12] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*
Posted by Benjamin Tissoires 3 weeks, 5 days ago
On Jan 12 2026, Jiri Kosina wrote:
> On Mon, 12 Jan 2026, Bastien Nocera wrote:
> 
> > All those changes should be safe, as similar ones were done in other
> > subsystems, but I'm uncertain about the surface changes.
> > 
> > Bastien Nocera (12):
> >   HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: appletb-kbd: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: asus: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: lenovo: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: logitech-dj: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: picolcd_core: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
> >   HID: surface: Use pm_ptr_sleep instead of #ifdef CONFIG_PM_SLEEP
> > 
> >  drivers/hid/hid-alps.c                     | 6 ++----
> >  drivers/hid/hid-appletb-kbd.c              | 6 ++----
> >  drivers/hid/hid-asus.c                     | 6 ++----
> >  drivers/hid/hid-lenovo.c                   | 4 +---
> >  drivers/hid/hid-logitech-dj.c              | 4 +---
> >  drivers/hid/hid-nintendo.c                 | 7 ++-----
> >  drivers/hid/hid-picolcd_core.c             | 8 +++-----
> >  drivers/hid/hid-sensor-hub.c               | 8 +++-----
> >  drivers/hid/hid-sony.c                     | 9 +++------
> >  drivers/hid/hid-uclogic-core.c             | 6 ++----
> >  drivers/hid/surface-hid/surface_hid.c      | 2 +-
> >  drivers/hid/surface-hid/surface_hid_core.c | 5 -----
> >  drivers/hid/surface-hid/surface_kbd.c      | 2 +-
> >  drivers/hid/wacom_sys.c                    | 6 ++----
> >  14 files changed, 25 insertions(+), 54 deletions(-)
> 
> Thanks Bastien, this is now in hid.git#for-6.20/pm_ptr.
> 

There is something wrong with the series:
https://gitlab.freedesktop.org/bentiss/hid/-/jobs/90949365

```
In file included from ./include/linux/kernel.h:36,
                 from ./include/linux/random.h:7,
                 from ./include/linux/nodemask.h:94,
                 from ./include/linux/numa.h:6,
                 from ./include/linux/cpumask.h:15,
                 from ./arch/x86/include/asm/cpumask.h:7,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/tsc.h:11,
                 from ./arch/x86/include/asm/timex.h:6,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from drivers/hid/hid-lenovo.c:27:
drivers/hid/hid-lenovo.c:1573:32: error: 'lenovo_reset_resume' undeclared here (not in a function); did you mean 'hidinput_reset_resume'?
 1573 |         .reset_resume = pm_ptr(lenovo_reset_resume),
      |                                ^~~~~~~~~~~~~~~~~~~
./include/linux/util_macros.h:136:44: note: in definition of macro 'PTR_IF'
  136 | #define PTR_IF(cond, ptr)       ((cond) ? (ptr) : NULL)
      |                                            ^~~
drivers/hid/hid-lenovo.c:1573:25: note: in expansion of macro 'pm_ptr'
 1573 |         .reset_resume = pm_ptr(lenovo_reset_resume),
      |                         ^~~~~~
make[4]: *** [scripts/Makefile.build:287: drivers/hid/hid-lenovo.o] Error 1
```


Bastien, are you sure that's the only change required?

Cheers,
Benjamin
Re: [PATCH 00/12] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*
Posted by Jiri Kosina 3 weeks, 5 days ago
On Mon, 12 Jan 2026, Benjamin Tissoires wrote:

> > > All those changes should be safe, as similar ones were done in other
> > > subsystems, but I'm uncertain about the surface changes.
> > > 
> > > Bastien Nocera (12):
> > >   HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: appletb-kbd: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: asus: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: lenovo: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: logitech-dj: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: picolcd_core: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
> > >   HID: surface: Use pm_ptr_sleep instead of #ifdef CONFIG_PM_SLEEP
> > > 
> > >  drivers/hid/hid-alps.c                     | 6 ++----
> > >  drivers/hid/hid-appletb-kbd.c              | 6 ++----
> > >  drivers/hid/hid-asus.c                     | 6 ++----
> > >  drivers/hid/hid-lenovo.c                   | 4 +---
> > >  drivers/hid/hid-logitech-dj.c              | 4 +---
> > >  drivers/hid/hid-nintendo.c                 | 7 ++-----
> > >  drivers/hid/hid-picolcd_core.c             | 8 +++-----
> > >  drivers/hid/hid-sensor-hub.c               | 8 +++-----
> > >  drivers/hid/hid-sony.c                     | 9 +++------
> > >  drivers/hid/hid-uclogic-core.c             | 6 ++----
> > >  drivers/hid/surface-hid/surface_hid.c      | 2 +-
> > >  drivers/hid/surface-hid/surface_hid_core.c | 5 -----
> > >  drivers/hid/surface-hid/surface_kbd.c      | 2 +-
> > >  drivers/hid/wacom_sys.c                    | 6 ++----
> > >  14 files changed, 25 insertions(+), 54 deletions(-)
> > 
> > Thanks Bastien, this is now in hid.git#for-6.20/pm_ptr.
> > 
> 
> There is something wrong with the series:
> https://gitlab.freedesktop.org/bentiss/hid/-/jobs/90949365

Yeah, and 0day bot found another issue. Dropping for now, this needs more 
polishing apparently :)

-- 
Jiri Kosina
SUSE Labs