Skip to content

Commit 6b94d7b

Browse files
jic23dtor
authored andcommitted
Input: mcs-touchkey - 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 ifdef guards. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent b946156 commit 6b94d7b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/input/keyboard/mcs_touchkey.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ static void mcs_touchkey_shutdown(struct i2c_client *client)
213213
data->poweron(false);
214214
}
215215

216-
#ifdef CONFIG_PM_SLEEP
217216
static int mcs_touchkey_suspend(struct device *dev)
218217
{
219218
struct mcs_touchkey_data *data = dev_get_drvdata(dev);
@@ -243,10 +242,9 @@ static int mcs_touchkey_resume(struct device *dev)
243242

244243
return 0;
245244
}
246-
#endif
247245

248-
static SIMPLE_DEV_PM_OPS(mcs_touchkey_pm_ops,
249-
mcs_touchkey_suspend, mcs_touchkey_resume);
246+
static DEFINE_SIMPLE_DEV_PM_OPS(mcs_touchkey_pm_ops,
247+
mcs_touchkey_suspend, mcs_touchkey_resume);
250248

251249
static const struct i2c_device_id mcs_touchkey_id[] = {
252250
{ "mcs5000_touchkey", MCS5000_TOUCHKEY },
@@ -258,7 +256,7 @@ MODULE_DEVICE_TABLE(i2c, mcs_touchkey_id);
258256
static struct i2c_driver mcs_touchkey_driver = {
259257
.driver = {
260258
.name = "mcs_touchkey",
261-
.pm = &mcs_touchkey_pm_ops,
259+
.pm = pm_sleep_ptr(&mcs_touchkey_pm_ops),
262260
},
263261
.probe_new = mcs_touchkey_probe,
264262
.remove = mcs_touchkey_remove,

0 commit comments

Comments
 (0)