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

Input: tsc200x - use EXPORT_GPL_SIMPLE_DEV_PM_OPS()

SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and EXPORT_GPL_SIMPLE_DEV_PM_OPS() allows the compiler to see the
functions, thus suppressing the warning, but still allowing the unused
code to be removed. Thus also drop the __maybe_unused markings.
This function also removes the need for separate EXPORT_SYMBOL_GPL()

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230114171620.42891-10-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
6470215b 40be0646

+5 -6
+1 -1
drivers/input/touchscreen/tsc2004.c
··· 65 65 .driver = { 66 66 .name = "tsc2004", 67 67 .of_match_table = of_match_ptr(tsc2004_of_match), 68 - .pm = &tsc200x_pm_ops, 68 + .pm = pm_sleep_ptr(&tsc200x_pm_ops), 69 69 }, 70 70 .id_table = tsc2004_idtable, 71 71 .probe_new = tsc2004_probe,
+1 -1
drivers/input/touchscreen/tsc2005.c
··· 81 81 .driver = { 82 82 .name = "tsc2005", 83 83 .of_match_table = of_match_ptr(tsc2005_of_match), 84 - .pm = &tsc200x_pm_ops, 84 + .pm = pm_sleep_ptr(&tsc200x_pm_ops), 85 85 }, 86 86 .probe = tsc2005_probe, 87 87 .remove = tsc2005_remove,
+3 -4
drivers/input/touchscreen/tsc200x-core.c
··· 588 588 } 589 589 EXPORT_SYMBOL_GPL(tsc200x_remove); 590 590 591 - static int __maybe_unused tsc200x_suspend(struct device *dev) 591 + static int tsc200x_suspend(struct device *dev) 592 592 { 593 593 struct tsc200x *ts = dev_get_drvdata(dev); 594 594 ··· 604 604 return 0; 605 605 } 606 606 607 - static int __maybe_unused tsc200x_resume(struct device *dev) 607 + static int tsc200x_resume(struct device *dev) 608 608 { 609 609 struct tsc200x *ts = dev_get_drvdata(dev); 610 610 ··· 620 620 return 0; 621 621 } 622 622 623 - SIMPLE_DEV_PM_OPS(tsc200x_pm_ops, tsc200x_suspend, tsc200x_resume); 624 - EXPORT_SYMBOL_GPL(tsc200x_pm_ops); 623 + EXPORT_GPL_SIMPLE_DEV_PM_OPS(tsc200x_pm_ops, tsc200x_suspend, tsc200x_resume); 625 624 626 625 MODULE_AUTHOR("Lauri Leukkunen <lauri.leukkunen@nokia.com>"); 627 626 MODULE_DESCRIPTION("TSC200x Touchscreen Driver Core");