Skip to content

Commit fc25434

Browse files
t-8chBenjamin Tissoires
authored andcommitted
HID: multitouch: remove #ifdef CONFIG_PM
Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent f354872 commit fc25434

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
18021802
return 0;
18031803
}
18041804

1805-
#ifdef CONFIG_PM
18061805
static int mt_suspend(struct hid_device *hdev, pm_message_t state)
18071806
{
18081807
struct mt_device *td = hid_get_drvdata(hdev);
@@ -1836,7 +1835,6 @@ static int mt_resume(struct hid_device *hdev)
18361835

18371836
return 0;
18381837
}
1839-
#endif
18401838

18411839
static void mt_remove(struct hid_device *hdev)
18421840
{
@@ -2259,10 +2257,8 @@ static struct hid_driver mt_driver = {
22592257
.usage_table = mt_grabbed_usages,
22602258
.event = mt_event,
22612259
.report = mt_report,
2262-
#ifdef CONFIG_PM
2263-
.suspend = mt_suspend,
2264-
.reset_resume = mt_reset_resume,
2265-
.resume = mt_resume,
2266-
#endif
2260+
.suspend = pm_ptr(mt_suspend),
2261+
.reset_resume = pm_ptr(mt_reset_resume),
2262+
.resume = pm_ptr(mt_resume),
22672263
};
22682264
module_hid_driver(mt_driver);

0 commit comments

Comments
 (0)