Commit fc254341 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Benjamin Tissoires

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: default avatarThomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-3-0a71531ca93b@weissschuh.netSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
parent f3548721
...@@ -1802,7 +1802,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -1802,7 +1802,6 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
return 0; return 0;
} }
#ifdef CONFIG_PM
static int mt_suspend(struct hid_device *hdev, pm_message_t state) static int mt_suspend(struct hid_device *hdev, pm_message_t state)
{ {
struct mt_device *td = hid_get_drvdata(hdev); struct mt_device *td = hid_get_drvdata(hdev);
...@@ -1836,7 +1835,6 @@ static int mt_resume(struct hid_device *hdev) ...@@ -1836,7 +1835,6 @@ static int mt_resume(struct hid_device *hdev)
return 0; return 0;
} }
#endif
static void mt_remove(struct hid_device *hdev) static void mt_remove(struct hid_device *hdev)
{ {
...@@ -2259,10 +2257,8 @@ static struct hid_driver mt_driver = { ...@@ -2259,10 +2257,8 @@ static struct hid_driver mt_driver = {
.usage_table = mt_grabbed_usages, .usage_table = mt_grabbed_usages,
.event = mt_event, .event = mt_event,
.report = mt_report, .report = mt_report,
#ifdef CONFIG_PM .suspend = pm_ptr(mt_suspend),
.suspend = mt_suspend, .reset_resume = pm_ptr(mt_reset_resume),
.reset_resume = mt_reset_resume, .resume = pm_ptr(mt_resume),
.resume = mt_resume,
#endif
}; };
module_hid_driver(mt_driver); module_hid_driver(mt_driver);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment