public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*
@ 2026-01-13  9:24 Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 01/11] HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM Bastien Nocera
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

Changes since v1:
- Fixed most patches to build
- Removed surface patch

All changes were compiled successfully with CONFIG_PM disabled.

Bastien Nocera (11):
  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: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
  HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM

 drivers/hid/hid-alps.c         |  6 ++----
 drivers/hid/hid-appletb-kbd.c  |  8 ++------
 drivers/hid/hid-asus.c         |  6 ++----
 drivers/hid/hid-lenovo.c       |  6 +-----
 drivers/hid/hid-logitech-dj.c  |  6 +-----
 drivers/hid/hid-nintendo.c     | 11 ++---------
 drivers/hid/hid-picolcd_core.c | 10 +++-------
 drivers/hid/hid-sensor-hub.c   | 10 +++-------
 drivers/hid/hid-sony.c         | 12 +++---------
 drivers/hid/hid-uclogic-core.c |  8 ++------
 drivers/hid/wacom_sys.c        |  8 ++------
 11 files changed, 23 insertions(+), 68 deletions(-)

-- 
2.52.0


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

* [PATCH v2 01/11] HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 02/11] HID: appletb-kbd: " Bastien Nocera
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-alps.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index ba00f6e6324b..21e55f3d0d1b 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -840,10 +840,8 @@ static struct hid_driver alps_driver = {
 	.raw_event		= alps_raw_event,
 	.input_mapping		= alps_input_mapping,
 	.input_configured	= alps_input_configured,
-#ifdef CONFIG_PM
-	.resume			= alps_post_resume,
-	.reset_resume		= alps_post_reset,
-#endif
+	.resume			= pm_ptr(alps_post_resume),
+	.reset_resume		= pm_ptr(alps_post_reset),
 };
 
 module_hid_driver(alps_driver);
-- 
2.52.0


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

* [PATCH v2 02/11] HID: appletb-kbd: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 01/11] HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 03/11] HID: asus: " Bastien Nocera
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-appletb-kbd.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/hid-appletb-kbd.c b/drivers/hid/hid-appletb-kbd.c
index b00687e67ce8..a1db3b3d0667 100644
--- a/drivers/hid/hid-appletb-kbd.c
+++ b/drivers/hid/hid-appletb-kbd.c
@@ -466,7 +466,6 @@ static void appletb_kbd_remove(struct hid_device *hdev)
 	hid_hw_stop(hdev);
 }
 
-#ifdef CONFIG_PM
 static int appletb_kbd_suspend(struct hid_device *hdev, pm_message_t msg)
 {
 	struct appletb_kbd *kbd = hid_get_drvdata(hdev);
@@ -485,7 +484,6 @@ static int appletb_kbd_reset_resume(struct hid_device *hdev)
 
 	return 0;
 }
-#endif
 
 static const struct hid_device_id appletb_kbd_hid_ids[] = {
 	/* MacBook Pro's 2018, 2019, with T2 chip: iBridge Display */
@@ -501,10 +499,8 @@ static struct hid_driver appletb_kbd_hid_driver = {
 	.remove = appletb_kbd_remove,
 	.event = appletb_kbd_hid_event,
 	.input_configured = appletb_kbd_input_configured,
-#ifdef CONFIG_PM
-	.suspend = appletb_kbd_suspend,
-	.reset_resume = appletb_kbd_reset_resume,
-#endif
+	.suspend = pm_ptr(appletb_kbd_suspend),
+	.reset_resume = pm_ptr(appletb_kbd_reset_resume),
 	.driver.dev_groups = appletb_kbd_groups,
 };
 module_hid_driver(appletb_kbd_hid_driver);
-- 
2.52.0


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

* [PATCH v2 03/11] HID: asus: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 01/11] HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 02/11] HID: appletb-kbd: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 04/11] HID: lenovo: " Bastien Nocera
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-asus.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 472bca54642b..0a4acdcb6386 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -1434,10 +1434,8 @@ static struct hid_driver asus_driver = {
 	.remove			= asus_remove,
 	.input_mapping          = asus_input_mapping,
 	.input_configured       = asus_input_configured,
-#ifdef CONFIG_PM
-	.reset_resume           = asus_reset_resume,
-	.resume					= asus_resume,
-#endif
+	.reset_resume           = pm_ptr(asus_reset_resume),
+	.resume			= pm_ptr(asus_resume),
 	.event			= asus_event,
 	.raw_event		= asus_raw_event
 };
-- 
2.52.0


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

* [PATCH v2 04/11] HID: lenovo: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (2 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 03/11] HID: asus: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 05/11] HID: logitech-dj: " Bastien Nocera
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-lenovo.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 9cc3e029e9f6..a6b73e03c16b 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -1422,7 +1422,6 @@ static int lenovo_probe(struct hid_device *hdev,
 	return ret;
 }
 
-#ifdef CONFIG_PM
 static int lenovo_reset_resume(struct hid_device *hdev)
 {
 	switch (hdev->product) {
@@ -1438,7 +1437,6 @@ static int lenovo_reset_resume(struct hid_device *hdev)
 
 	return 0;
 }
-#endif
 
 static void lenovo_remove_tpkbd(struct hid_device *hdev)
 {
@@ -1570,9 +1568,7 @@ static struct hid_driver lenovo_driver = {
 	.raw_event = lenovo_raw_event,
 	.event = lenovo_event,
 	.report_fixup = lenovo_report_fixup,
-#ifdef CONFIG_PM
-	.reset_resume = lenovo_reset_resume,
-#endif
+	.reset_resume = pm_ptr(lenovo_reset_resume),
 };
 module_hid_driver(lenovo_driver);
 
-- 
2.52.0


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

* [PATCH v2 05/11] HID: logitech-dj: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (3 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 04/11] HID: lenovo: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 06/11] HID: nintendo: " Bastien Nocera
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-logitech-dj.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index 44b716697510..3d8821d5b2d2 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -1983,7 +1983,6 @@ static int logi_dj_probe(struct hid_device *hdev,
 	return retval;
 }
 
-#ifdef CONFIG_PM
 static int logi_dj_reset_resume(struct hid_device *hdev)
 {
 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
@@ -1994,7 +1993,6 @@ static int logi_dj_reset_resume(struct hid_device *hdev)
 	logi_dj_recv_switch_to_dj_mode(djrcv_dev, 0);
 	return 0;
 }
-#endif
 
 static void logi_dj_remove(struct hid_device *hdev)
 {
@@ -2150,9 +2148,7 @@ static struct hid_driver logi_djreceiver_driver = {
 	.probe = logi_dj_probe,
 	.remove = logi_dj_remove,
 	.raw_event = logi_dj_raw_event,
-#ifdef CONFIG_PM
-	.reset_resume = logi_dj_reset_resume,
-#endif
+	.reset_resume = pm_ptr(logi_dj_reset_resume),
 };
 
 module_hid_driver(logi_djreceiver_driver);
-- 
2.52.0


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

* [PATCH v2 06/11] HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (4 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 05/11] HID: logitech-dj: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 07/11] HID: picolcd_core: " Bastien Nocera
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-nintendo.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 7ac9217d9096..29008c2cc530 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -2748,8 +2748,6 @@ static void nintendo_hid_remove(struct hid_device *hdev)
 	hid_hw_stop(hdev);
 }
 
-#ifdef CONFIG_PM
-
 static int nintendo_hid_resume(struct hid_device *hdev)
 {
 	struct joycon_ctlr *ctlr = hid_get_drvdata(hdev);
@@ -2792,8 +2790,6 @@ static int nintendo_hid_suspend(struct hid_device *hdev, pm_message_t message)
 	return 0;
 }
 
-#endif
-
 static const struct hid_device_id nintendo_hid_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_NINTENDO,
 			 USB_DEVICE_ID_NINTENDO_PROCON) },
@@ -2827,11 +2823,8 @@ static struct hid_driver nintendo_hid_driver = {
 	.probe		= nintendo_hid_probe,
 	.remove		= nintendo_hid_remove,
 	.raw_event	= nintendo_hid_event,
-
-#ifdef CONFIG_PM
-	.resume		= nintendo_hid_resume,
-	.suspend	= nintendo_hid_suspend,
-#endif
+	.resume		= pm_ptr(nintendo_hid_resume),
+	.suspend	= pm_ptr(nintendo_hid_suspend),
 };
 static int __init nintendo_init(void)
 {
-- 
2.52.0


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

* [PATCH v2 07/11] HID: picolcd_core: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (5 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 06/11] HID: nintendo: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 08/11] HID: hid-sensor-hub: " Bastien Nocera
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-picolcd_core.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c
index 297103be3381..6a88e6bc70f3 100644
--- a/drivers/hid/hid-picolcd_core.c
+++ b/drivers/hid/hid-picolcd_core.c
@@ -363,7 +363,6 @@ static int picolcd_raw_event(struct hid_device *hdev,
 	return 1;
 }
 
-#ifdef CONFIG_PM
 static int picolcd_suspend(struct hid_device *hdev, pm_message_t message)
 {
 	if (PMSG_IS_AUTO(message))
@@ -401,7 +400,6 @@ static int picolcd_reset_resume(struct hid_device *hdev)
 	picolcd_leds_set(hid_get_drvdata(hdev));
 	return 0;
 }
-#endif
 
 /* initialize keypad input device */
 static int picolcd_init_keys(struct picolcd_data *data,
@@ -648,11 +646,9 @@ static struct hid_driver picolcd_driver = {
 	.probe =         picolcd_probe,
 	.remove =        picolcd_remove,
 	.raw_event =     picolcd_raw_event,
-#ifdef CONFIG_PM
-	.suspend =       picolcd_suspend,
-	.resume =        picolcd_resume,
-	.reset_resume =  picolcd_reset_resume,
-#endif
+	.suspend =       pm_ptr(picolcd_suspend),
+	.resume =        pm_ptr(picolcd_resume),
+	.reset_resume =  pm_ptr(picolcd_reset_resume),
 };
 module_hid_driver(picolcd_driver);
 
-- 
2.52.0


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

* [PATCH v2 08/11] HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (6 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 07/11] HID: picolcd_core: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 09/11] HID: uclogic: " Bastien Nocera
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-sensor-hub.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 4c94c03cb573..0edec902be41 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -422,7 +422,6 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
 }
 EXPORT_SYMBOL_GPL(sensor_hub_input_get_attribute_info);
 
-#ifdef CONFIG_PM
 static int sensor_hub_suspend(struct hid_device *hdev, pm_message_t message)
 {
 	struct sensor_hub_data *pdata = hid_get_drvdata(hdev);
@@ -463,7 +462,6 @@ static int sensor_hub_reset_resume(struct hid_device *hdev)
 {
 	return 0;
 }
-#endif
 
 /*
  * Handle raw report as sent by device
@@ -772,11 +770,9 @@ static struct hid_driver sensor_hub_driver = {
 	.remove = sensor_hub_remove,
 	.raw_event = sensor_hub_raw_event,
 	.report_fixup = sensor_hub_report_fixup,
-#ifdef CONFIG_PM
-	.suspend = sensor_hub_suspend,
-	.resume = sensor_hub_resume,
-	.reset_resume = sensor_hub_reset_resume,
-#endif
+	.suspend = pm_ptr(sensor_hub_suspend),
+	.resume = pm_ptr(sensor_hub_resume),
+	.reset_resume = pm_ptr(sensor_hub_reset_resume),
 };
 module_hid_driver(sensor_hub_driver);
 
-- 
2.52.0


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

* [PATCH v2 09/11] HID: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (7 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 08/11] HID: hid-sensor-hub: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 10/11] HID: wacom: " Bastien Nocera
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-uclogic-core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index 90ebb81041ea..bd7f93e96e4e 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -268,7 +268,6 @@ static int uclogic_probe(struct hid_device *hdev,
 	return rc;
 }
 
-#ifdef CONFIG_PM
 static int uclogic_resume(struct hid_device *hdev)
 {
 	int rc;
@@ -283,7 +282,6 @@ static int uclogic_resume(struct hid_device *hdev)
 
 	return rc;
 }
-#endif
 
 /**
  * uclogic_exec_event_hook - if the received event is hooked schedules the
@@ -636,10 +634,8 @@ static struct hid_driver uclogic_driver = {
 	.raw_event = uclogic_raw_event,
 	.input_mapping = uclogic_input_mapping,
 	.input_configured = uclogic_input_configured,
-#ifdef CONFIG_PM
-	.resume	          = uclogic_resume,
-	.reset_resume     = uclogic_resume,
-#endif
+	.resume	          = pm_ptr(uclogic_resume),
+	.reset_resume     = pm_ptr(uclogic_resume),
 };
 module_hid_driver(uclogic_driver);
 
-- 
2.52.0


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

* [PATCH v2 10/11] HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (8 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 09/11] HID: uclogic: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-13  9:24 ` [PATCH v2 11/11] HID: sony: " Bastien Nocera
  2026-01-21 14:00 ` [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Jiri Kosina
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/wacom_sys.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 9a57504e51a1..afc900560706 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2921,7 +2921,6 @@ static void wacom_remove(struct hid_device *hdev)
 		wacom_release_resources(wacom);
 }
 
-#ifdef CONFIG_PM
 static int wacom_resume(struct hid_device *hdev)
 {
 	struct wacom *wacom = hid_get_drvdata(hdev);
@@ -2941,7 +2940,6 @@ static int wacom_reset_resume(struct hid_device *hdev)
 {
 	return wacom_resume(hdev);
 }
-#endif /* CONFIG_PM */
 
 static struct hid_driver wacom_driver = {
 	.name =		"wacom",
@@ -2949,10 +2947,8 @@ static struct hid_driver wacom_driver = {
 	.probe =	wacom_probe,
 	.remove =	wacom_remove,
 	.report =	wacom_wac_report,
-#ifdef CONFIG_PM
-	.resume =	wacom_resume,
-	.reset_resume =	wacom_reset_resume,
-#endif
+	.resume =	pm_ptr(wacom_resume),
+	.reset_resume =	pm_ptr(wacom_reset_resume),
 	.raw_event =	wacom_raw_event,
 };
 module_hid_driver(wacom_driver);
-- 
2.52.0


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

* [PATCH v2 11/11] HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (9 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 10/11] HID: wacom: " Bastien Nocera
@ 2026-01-13  9:24 ` Bastien Nocera
  2026-01-21 14:00 ` [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Jiri Kosina
  11 siblings, 0 replies; 13+ messages in thread
From: Bastien Nocera @ 2026-01-13  9:24 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires, Bastien Nocera

This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera <hadess@hadess.net>
---
 drivers/hid/hid-sony.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b966e4044238..de8135c1e3df 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2179,7 +2179,6 @@ static void sony_remove(struct hid_device *hdev)
 	hid_hw_stop(hdev);
 }
 
-#ifdef CONFIG_PM
 
 static int sony_suspend(struct hid_device *hdev, pm_message_t message)
 {
@@ -2214,8 +2213,6 @@ static int sony_resume(struct hid_device *hdev)
 	return 0;
 }
 
-#endif
-
 static const struct hid_device_id sony_devices[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
 		.driver_data = SIXAXIS_CONTROLLER_USB },
@@ -2284,12 +2281,9 @@ static struct hid_driver sony_driver = {
 	.remove           = sony_remove,
 	.report_fixup     = sony_report_fixup,
 	.raw_event        = sony_raw_event,
-
-#ifdef CONFIG_PM
-	.suspend          = sony_suspend,
-	.resume	          = sony_resume,
-	.reset_resume     = sony_resume,
-#endif
+	.suspend          = pm_ptr(sony_suspend),
+	.resume	          = pm_ptr(sony_resume),
+	.reset_resume     = pm_ptr(sony_resume),
 };
 
 static int __init sony_init(void)
-- 
2.52.0


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

* Re: [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM*
  2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
                   ` (10 preceding siblings ...)
  2026-01-13  9:24 ` [PATCH v2 11/11] HID: sony: " Bastien Nocera
@ 2026-01-21 14:00 ` Jiri Kosina
  11 siblings, 0 replies; 13+ messages in thread
From: Jiri Kosina @ 2026-01-21 14:00 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-input, linux-kernel, Benjamin Tissoires

On Tue, 13 Jan 2026, Bastien Nocera wrote:

> Changes since v1:
> - Fixed most patches to build
> - Removed surface patch
> 
> All changes were compiled successfully with CONFIG_PM disabled.
> 
> Bastien Nocera (11):
>   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: uclogic: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: wacom: Use pm_ptr instead of #ifdef CONFIG_PM
>   HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM

Now queued in hid.git#for-6.20/pm_ptr-v2.

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2026-01-21 14:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13  9:24 [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 01/11] HID: hid-alps: Use pm_ptr instead of #ifdef CONFIG_PM Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 02/11] HID: appletb-kbd: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 03/11] HID: asus: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 04/11] HID: lenovo: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 05/11] HID: logitech-dj: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 06/11] HID: nintendo: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 07/11] HID: picolcd_core: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 08/11] HID: hid-sensor-hub: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 09/11] HID: uclogic: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 10/11] HID: wacom: " Bastien Nocera
2026-01-13  9:24 ` [PATCH v2 11/11] HID: sony: " Bastien Nocera
2026-01-21 14:00 ` [PATCH v2 00/11] HID: Use pm_*ptr instead of #ifdef CONFIG_PM* Jiri Kosina

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