Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-3-0a71531ca93b@weissschuh.net
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

authored by

Thomas Weißschuh and committed by
Benjamin Tissoires
fc254341 f3548721

+3 -7
+3 -7
drivers/hid/hid-multitouch.c
··· 1802 1802 return 0; 1803 1803 } 1804 1804 1805 - #ifdef CONFIG_PM 1806 1805 static int mt_suspend(struct hid_device *hdev, pm_message_t state) 1807 1806 { 1808 1807 struct mt_device *td = hid_get_drvdata(hdev); ··· 1835 1836 1836 1837 return 0; 1837 1838 } 1838 - #endif 1839 1839 1840 1840 static void mt_remove(struct hid_device *hdev) 1841 1841 { ··· 2257 2259 .usage_table = mt_grabbed_usages, 2258 2260 .event = mt_event, 2259 2261 .report = mt_report, 2260 - #ifdef CONFIG_PM 2261 - .suspend = mt_suspend, 2262 - .reset_resume = mt_reset_resume, 2263 - .resume = mt_resume, 2264 - #endif 2262 + .suspend = pm_ptr(mt_suspend), 2263 + .reset_resume = pm_ptr(mt_reset_resume), 2264 + .resume = pm_ptr(mt_resume), 2265 2265 }; 2266 2266 module_hid_driver(mt_driver);