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

Input: hideep - 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: Anthony Kim <anthony.kim@hideep.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230102181842.718010-48-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
311fd6b0 05ebb78b

+4 -4
+4 -4
drivers/input/touchscreen/hideep.c
··· 959 959 .attrs = hideep_ts_sysfs_entries, 960 960 }; 961 961 962 - static int __maybe_unused hideep_suspend(struct device *dev) 962 + static int hideep_suspend(struct device *dev) 963 963 { 964 964 struct i2c_client *client = to_i2c_client(dev); 965 965 struct hideep_ts *ts = i2c_get_clientdata(client); ··· 970 970 return 0; 971 971 } 972 972 973 - static int __maybe_unused hideep_resume(struct device *dev) 973 + static int hideep_resume(struct device *dev) 974 974 { 975 975 struct i2c_client *client = to_i2c_client(dev); 976 976 struct hideep_ts *ts = i2c_get_clientdata(client); ··· 987 987 return 0; 988 988 } 989 989 990 - static SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); 990 + static DEFINE_SIMPLE_DEV_PM_OPS(hideep_pm_ops, hideep_suspend, hideep_resume); 991 991 992 992 static const struct regmap_config hideep_regmap_config = { 993 993 .reg_bits = 16, ··· 1108 1108 .name = HIDEEP_I2C_NAME, 1109 1109 .of_match_table = of_match_ptr(hideep_match_table), 1110 1110 .acpi_match_table = ACPI_PTR(hideep_acpi_id), 1111 - .pm = &hideep_pm_ops, 1111 + .pm = pm_sleep_ptr(&hideep_pm_ops), 1112 1112 }, 1113 1113 .id_table = hideep_i2c_id, 1114 1114 .probe_new = hideep_probe,