Input: cyttsp4 - use EXPORT_GPL_RUNTIME_DEV_PM_OPS()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 14 Jan 2023 17:16:14 +0000 (17:16 +0000)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 27 Jan 2023 22:49:53 +0000 (14:49 -0800)
commitebbdbef28facff7ceadc091aa5279b3751da1d4a
treee8f3de97dff5c30475a71b38f7c9e8c790899c83
parent6470215b883eba58909871ec2268f734f1b3d646
Input: cyttsp4 - use EXPORT_GPL_RUNTIME_DEV_PM_OPS()

SET_SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() are deprecated as
they requires explicit protection against unused function warnings.
The new combination of pm_ptr() EXPORT_GPL_RUNTIME_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 #ifdef guards.

Note that we are replacing an unconditional call to the suspend
and resume functions for sleep use cases with one via
pm_runtime_force_suspend() / pm_runtime_force_resume() that only
do anything to the device if we are not already in the appropriate
runtime suspended state.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
--

I 'think' this should be fine in that it can only reduce the number
of unnecessary suspends.  If anyone can test that would be great.

Link: https://lore.kernel.org/r/20230114171620.42891-11-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/cyttsp4_core.c
drivers/input/touchscreen/cyttsp4_i2c.c
drivers/input/touchscreen/cyttsp4_spi.c