summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2026-02-09 17:37:58 +0100
committerJiri Kosina <jkosina@suse.com>2026-02-09 17:37:58 +0100
commit33312c4d5ed81506d477bc55981fca0654cb7120 (patch)
treef5f708385e15d50541d2de8bbe72dde655c63322 /drivers/hid
parente2ec6d67e4a53d61398d9a37e5160b7a272d744a (diff)
parentff7ed83beab92d304f326a98c575c9fff7503f4c (diff)
downloadlinux-33312c4d5ed81506d477bc55981fca0654cb7120.tar.gz
linux-33312c4d5ed81506d477bc55981fca0654cb7120.tar.bz2
linux-33312c4d5ed81506d477bc55981fca0654cb7120.zip
Merge branch 'for-6.20/pm_ptr-v3' into for-linus
- Use pm_*ptr instead of #ifdef CONFIG_PM* (Bastien Nocera)
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-alps.c6
-rw-r--r--drivers/hid/hid-appletb-kbd.c8
-rw-r--r--drivers/hid/hid-asus.c6
-rw-r--r--drivers/hid/hid-lenovo.c6
-rw-r--r--drivers/hid/hid-logitech-dj.c6
-rw-r--r--drivers/hid/hid-nintendo.c11
-rw-r--r--drivers/hid/hid-picolcd_core.c10
-rw-r--r--drivers/hid/hid-sensor-hub.c10
-rw-r--r--drivers/hid/hid-sony.c12
-rw-r--r--drivers/hid/hid-uclogic-core.c8
-rw-r--r--drivers/hid/wacom_sys.c8
11 files changed, 23 insertions, 68 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);
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);
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index bfd46e2d4145..df7c03dde67f 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -1540,10 +1540,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
};
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 @@ err:
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);
diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
index e728f00f5bdc..c41fded63f4b 100644
--- a/drivers/hid/hid-logitech-dj.c
+++ b/drivers/hid/hid-logitech-dj.c
@@ -1983,7 +1983,6 @@ hid_hw_start_fail:
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);
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)
{
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);
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);
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 836ce74764a8..a89af14e4acc 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2286,7 +2286,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)
{
@@ -2321,8 +2320,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 },
@@ -2409,12 +2406,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)
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 @@ failure:
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);
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);