Skip to content

Commit d7192e4

Browse files
hadessJiri Kosina
authored andcommitted
HID: appletb-kbd: 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 5e130f5 commit d7192e4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/hid/hid-appletb-kbd.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ static void appletb_kbd_remove(struct hid_device *hdev)
466466
hid_hw_stop(hdev);
467467
}
468468

469-
#ifdef CONFIG_PM
470469
static int appletb_kbd_suspend(struct hid_device *hdev, pm_message_t msg)
471470
{
472471
struct appletb_kbd *kbd = hid_get_drvdata(hdev);
@@ -485,7 +484,6 @@ static int appletb_kbd_reset_resume(struct hid_device *hdev)
485484

486485
return 0;
487486
}
488-
#endif
489487

490488
static const struct hid_device_id appletb_kbd_hid_ids[] = {
491489
/* MacBook Pro's 2018, 2019, with T2 chip: iBridge Display */
@@ -501,10 +499,8 @@ static struct hid_driver appletb_kbd_hid_driver = {
501499
.remove = appletb_kbd_remove,
502500
.event = appletb_kbd_hid_event,
503501
.input_configured = appletb_kbd_input_configured,
504-
#ifdef CONFIG_PM
505-
.suspend = appletb_kbd_suspend,
506-
.reset_resume = appletb_kbd_reset_resume,
507-
#endif
502+
.suspend = pm_ptr(appletb_kbd_suspend),
503+
.reset_resume = pm_ptr(appletb_kbd_reset_resume),
508504
.driver.dev_groups = appletb_kbd_groups,
509505
};
510506
module_hid_driver(appletb_kbd_hid_driver);

0 commit comments

Comments
 (0)