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

Input: ilitek_ts_i2c - 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: Joe Hung <joe_hung@ilitek.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-49-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
4024f848 311fd6b0

+4 -4
+4 -4
drivers/input/touchscreen/ilitek_ts_i2c.c
··· 604 604 return 0; 605 605 } 606 606 607 - static int __maybe_unused ilitek_suspend(struct device *dev) 607 + static int ilitek_suspend(struct device *dev) 608 608 { 609 609 struct i2c_client *client = to_i2c_client(dev); 610 610 struct ilitek_ts_data *ts = i2c_get_clientdata(client); ··· 621 621 return 0; 622 622 } 623 623 624 - static int __maybe_unused ilitek_resume(struct device *dev) 624 + static int ilitek_resume(struct device *dev) 625 625 { 626 626 struct i2c_client *client = to_i2c_client(dev); 627 627 struct ilitek_ts_data *ts = i2c_get_clientdata(client); ··· 640 640 return 0; 641 641 } 642 642 643 - static SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume); 643 + static DEFINE_SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume); 644 644 645 645 static const struct i2c_device_id ilitek_ts_i2c_id[] = { 646 646 { ILITEK_TS_NAME, 0 }, ··· 675 675 static struct i2c_driver ilitek_ts_i2c_driver = { 676 676 .driver = { 677 677 .name = ILITEK_TS_NAME, 678 - .pm = &ilitek_pm_ops, 678 + .pm = pm_sleep_ptr(&ilitek_pm_ops), 679 679 .of_match_table = of_match_ptr(ilitek_ts_i2c_match), 680 680 .acpi_match_table = ACPI_PTR(ilitekts_acpi_id), 681 681 },