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

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 <Jonathan.Cameron@huawei.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230114171620.42891-12-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
c3c2f2bc ebbdbef2

+5 -6
+3 -4
drivers/input/touchscreen/cyttsp_core.c
··· 491 491 return 0; 492 492 } 493 493 494 - static int __maybe_unused cyttsp_suspend(struct device *dev) 494 + static int cyttsp_suspend(struct device *dev) 495 495 { 496 496 struct cyttsp *ts = dev_get_drvdata(dev); 497 497 int retval = 0; ··· 509 509 return retval; 510 510 } 511 511 512 - static int __maybe_unused cyttsp_resume(struct device *dev) 512 + static int cyttsp_resume(struct device *dev) 513 513 { 514 514 struct cyttsp *ts = dev_get_drvdata(dev); 515 515 ··· 525 525 return 0; 526 526 } 527 527 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); 530 529 531 530 static int cyttsp_open(struct input_dev *dev) 532 531 {
+1 -1
drivers/input/touchscreen/cyttsp_i2c.c
··· 63 63 static struct i2c_driver cyttsp_i2c_driver = { 64 64 .driver = { 65 65 .name = CY_I2C_NAME, 66 - .pm = &cyttsp_pm_ops, 66 + .pm = pm_sleep_ptr(&cyttsp_pm_ops), 67 67 .of_match_table = cyttsp_of_i2c_match, 68 68 }, 69 69 .probe_new = cyttsp_i2c_probe,
+1 -1
drivers/input/touchscreen/cyttsp_spi.c
··· 172 172 static struct spi_driver cyttsp_spi_driver = { 173 173 .driver = { 174 174 .name = CY_SPI_NAME, 175 - .pm = &cyttsp_pm_ops, 175 + .pm = pm_sleep_ptr(&cyttsp_pm_ops), 176 176 .of_match_table = cyttsp_of_spi_match, 177 177 }, 178 178 .probe = cyttsp_spi_probe,