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

Input: imagis - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()

SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and DEFINE_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.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Markuss Broks <markuss.broks@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-50-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
a9b11330 4024f848

+4 -4
+4 -4
drivers/input/touchscreen/imagis.c
··· 309 309 return 0; 310 310 } 311 311 312 - static int __maybe_unused imagis_suspend(struct device *dev) 312 + static int imagis_suspend(struct device *dev) 313 313 { 314 314 struct i2c_client *client = to_i2c_client(dev); 315 315 struct imagis_ts *ts = i2c_get_clientdata(client); ··· 325 325 return retval; 326 326 } 327 327 328 - static int __maybe_unused imagis_resume(struct device *dev) 328 + static int imagis_resume(struct device *dev) 329 329 { 330 330 struct i2c_client *client = to_i2c_client(dev); 331 331 struct imagis_ts *ts = i2c_get_clientdata(client); ··· 341 341 return retval; 342 342 } 343 343 344 - static SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); 344 + static DEFINE_SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); 345 345 346 346 #ifdef CONFIG_OF 347 347 static const struct of_device_id imagis_of_match[] = { ··· 354 354 static struct i2c_driver imagis_ts_driver = { 355 355 .driver = { 356 356 .name = "imagis-touchscreen", 357 - .pm = &imagis_pm_ops, 357 + .pm = pm_sleep_ptr(&imagis_pm_ops), 358 358 .of_match_table = of_match_ptr(imagis_of_match), 359 359 }, 360 360 .probe_new = imagis_probe,