Skip to content

Commit d7b7ce3

Browse files
hadessJiri Kosina
authored andcommitted
HID: nintendo: Use pm_ptr instead of #ifdef CONFIG_PM
This increases build coverage and allows to drop an #ifdef. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent dcd2c35 commit d7b7ce3

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

drivers/hid/hid-nintendo.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,8 +2748,6 @@ static void nintendo_hid_remove(struct hid_device *hdev)
27482748
hid_hw_stop(hdev);
27492749
}
27502750

2751-
#ifdef CONFIG_PM
2752-
27532751
static int nintendo_hid_resume(struct hid_device *hdev)
27542752
{
27552753
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)
27922790
return 0;
27932791
}
27942792

2795-
#endif
2796-
27972793
static const struct hid_device_id nintendo_hid_devices[] = {
27982794
{ HID_USB_DEVICE(USB_VENDOR_ID_NINTENDO,
27992795
USB_DEVICE_ID_NINTENDO_PROCON) },
@@ -2827,11 +2823,8 @@ static struct hid_driver nintendo_hid_driver = {
28272823
.probe = nintendo_hid_probe,
28282824
.remove = nintendo_hid_remove,
28292825
.raw_event = nintendo_hid_event,
2830-
2831-
#ifdef CONFIG_PM
2832-
.resume = nintendo_hid_resume,
2833-
.suspend = nintendo_hid_suspend,
2834-
#endif
2826+
.resume = pm_ptr(nintendo_hid_resume),
2827+
.suspend = pm_ptr(nintendo_hid_suspend),
28352828
};
28362829
static int __init nintendo_init(void)
28372830
{

0 commit comments

Comments
 (0)