Skip to content

Commit c3c2f2b

Browse files
jic23dtor
authored andcommitted
Input: cyttsp - 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_PMU_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. It also rolls in the EXPORT_SYMBOL() so that we only export it if CONFIG_PM_SLEEP. Signed-off-by: Jonathan Cameron <[email protected]> Cc: Javier Martinez Canillas <[email protected]> Cc: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent ebbdbef commit c3c2f2b

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

drivers/input/touchscreen/cyttsp_core.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static int cyttsp_disable(struct cyttsp *ts)
491491
return 0;
492492
}
493493

494-
static int __maybe_unused cyttsp_suspend(struct device *dev)
494+
static int cyttsp_suspend(struct device *dev)
495495
{
496496
struct cyttsp *ts = dev_get_drvdata(dev);
497497
int retval = 0;
@@ -509,7 +509,7 @@ static int __maybe_unused cyttsp_suspend(struct device *dev)
509509
return retval;
510510
}
511511

512-
static int __maybe_unused cyttsp_resume(struct device *dev)
512+
static int cyttsp_resume(struct device *dev)
513513
{
514514
struct cyttsp *ts = dev_get_drvdata(dev);
515515

@@ -525,8 +525,7 @@ static int __maybe_unused cyttsp_resume(struct device *dev)
525525
return 0;
526526
}
527527

528-
SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume);
529-
EXPORT_SYMBOL_GPL(cyttsp_pm_ops);
528+
EXPORT_GPL_SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume);
530529

531530
static int cyttsp_open(struct input_dev *dev)
532531
{

drivers/input/touchscreen/cyttsp_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ MODULE_DEVICE_TABLE(of, cyttsp_of_i2c_match);
6363
static struct i2c_driver cyttsp_i2c_driver = {
6464
.driver = {
6565
.name = CY_I2C_NAME,
66-
.pm = &cyttsp_pm_ops,
66+
.pm = pm_sleep_ptr(&cyttsp_pm_ops),
6767
.of_match_table = cyttsp_of_i2c_match,
6868
},
6969
.probe_new = cyttsp_i2c_probe,

drivers/input/touchscreen/cyttsp_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, cyttsp_of_spi_match);
172172
static struct spi_driver cyttsp_spi_driver = {
173173
.driver = {
174174
.name = CY_SPI_NAME,
175-
.pm = &cyttsp_pm_ops,
175+
.pm = pm_sleep_ptr(&cyttsp_pm_ops),
176176
.of_match_table = cyttsp_of_spi_match,
177177
},
178178
.probe = cyttsp_spi_probe,

0 commit comments

Comments
 (0)