Merge branch 'for-6.20/pm_ptr-v3' into for-linus

- Use pm_*ptr instead of #ifdef CONFIG_PM* (Bastien Nocera)
This commit is contained in:
Jiri Kosina 2026-02-09 17:37:58 +01:00
commit 33312c4d5e
11 changed files with 23 additions and 68 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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
};

View file

@ -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);

View file

@ -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);

View file

@ -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)
{

View file

@ -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);

View file

@ -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);

View file

@ -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)

View file

@ -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);

View file

@ -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);