Skip to content

Commit ff7ed83

Browse files
hadessJiri Kosina
authored andcommitted
HID: sony: Use pm_ptr instead of #ifdef CONFIG_PM
This increases build coverage and allows to drop an #ifdef. Signed-off-by: Bastien Nocera <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent a864d16 commit ff7ed83

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

drivers/hid/hid-sony.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,7 +2179,6 @@ static void sony_remove(struct hid_device *hdev)
21792179
hid_hw_stop(hdev);
21802180
}
21812181

2182-
#ifdef CONFIG_PM
21832182

21842183
static int sony_suspend(struct hid_device *hdev, pm_message_t message)
21852184
{
@@ -2214,8 +2213,6 @@ static int sony_resume(struct hid_device *hdev)
22142213
return 0;
22152214
}
22162215

2217-
#endif
2218-
22192216
static const struct hid_device_id sony_devices[] = {
22202217
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER),
22212218
.driver_data = SIXAXIS_CONTROLLER_USB },
@@ -2284,12 +2281,9 @@ static struct hid_driver sony_driver = {
22842281
.remove = sony_remove,
22852282
.report_fixup = sony_report_fixup,
22862283
.raw_event = sony_raw_event,
2287-
2288-
#ifdef CONFIG_PM
2289-
.suspend = sony_suspend,
2290-
.resume = sony_resume,
2291-
.reset_resume = sony_resume,
2292-
#endif
2284+
.suspend = pm_ptr(sony_suspend),
2285+
.resume = pm_ptr(sony_resume),
2286+
.reset_resume = pm_ptr(sony_resume),
22932287
};
22942288

22952289
static int __init sony_init(void)

0 commit comments

Comments
 (0)