Skip to content

Commit 6470215

Browse files
jic23dtor
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 40be064 commit 6470215

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

drivers/input/touchscreen/tsc2004.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static struct i2c_driver tsc2004_driver = {
6565
.driver = {
6666
.name = "tsc2004",
6767
.of_match_table = of_match_ptr(tsc2004_of_match),
68-
.pm = &tsc200x_pm_ops,
68+
.pm = pm_sleep_ptr(&tsc200x_pm_ops),
6969
},
7070
.id_table = tsc2004_idtable,
7171
.probe_new = tsc2004_probe,

drivers/input/touchscreen/tsc2005.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static struct spi_driver tsc2005_driver = {
8181
.driver = {
8282
.name = "tsc2005",
8383
.of_match_table = of_match_ptr(tsc2005_of_match),
84-
.pm = &tsc200x_pm_ops,
84+
.pm = pm_sleep_ptr(&tsc200x_pm_ops),
8585
},
8686
.probe = tsc2005_probe,
8787
.remove = tsc2005_remove,

drivers/input/touchscreen/tsc200x-core.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ void tsc200x_remove(struct device *dev)
588588
}
589589
EXPORT_SYMBOL_GPL(tsc200x_remove);
590590

591-
static int __maybe_unused tsc200x_suspend(struct device *dev)
591+
static int tsc200x_suspend(struct device *dev)
592592
{
593593
struct tsc200x *ts = dev_get_drvdata(dev);
594594

@@ -604,7 +604,7 @@ static int __maybe_unused tsc200x_suspend(struct device *dev)
604604
return 0;
605605
}
606606

607-
static int __maybe_unused tsc200x_resume(struct device *dev)
607+
static int tsc200x_resume(struct device *dev)
608608
{
609609
struct tsc200x *ts = dev_get_drvdata(dev);
610610

@@ -620,8 +620,7 @@ static int __maybe_unused tsc200x_resume(struct device *dev)
620620
return 0;
621621
}
622622

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);
625624

626625
MODULE_AUTHOR("Lauri Leukkunen <[email protected]>");
627626
MODULE_DESCRIPTION("TSC200x Touchscreen Driver Core");

0 commit comments

Comments
 (0)