Skip to content

Commit fbfb262

Browse files
jic23dtor
authored andcommitted
Input: cypress-sf - 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent ca219cf commit fbfb262

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/keyboard/cypress-sf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int cypress_sf_probe(struct i2c_client *client)
168168
return 0;
169169
};
170170

171-
static int __maybe_unused cypress_sf_suspend(struct device *dev)
171+
static int cypress_sf_suspend(struct device *dev)
172172
{
173173
struct i2c_client *client = to_i2c_client(dev);
174174
struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
@@ -187,7 +187,7 @@ static int __maybe_unused cypress_sf_suspend(struct device *dev)
187187
return 0;
188188
}
189189

190-
static int __maybe_unused cypress_sf_resume(struct device *dev)
190+
static int cypress_sf_resume(struct device *dev)
191191
{
192192
struct i2c_client *client = to_i2c_client(dev);
193193
struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
@@ -205,8 +205,8 @@ static int __maybe_unused cypress_sf_resume(struct device *dev)
205205
return 0;
206206
}
207207

208-
static SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
209-
cypress_sf_suspend, cypress_sf_resume);
208+
static DEFINE_SIMPLE_DEV_PM_OPS(cypress_sf_pm_ops,
209+
cypress_sf_suspend, cypress_sf_resume);
210210

211211
static struct i2c_device_id cypress_sf_id_table[] = {
212212
{ CYPRESS_SF_DEV_NAME, 0 },
@@ -225,7 +225,7 @@ MODULE_DEVICE_TABLE(of, cypress_sf_of_match);
225225
static struct i2c_driver cypress_sf_driver = {
226226
.driver = {
227227
.name = CYPRESS_SF_DEV_NAME,
228-
.pm = &cypress_sf_pm_ops,
228+
.pm = pm_sleep_ptr(&cypress_sf_pm_ops),
229229
.of_match_table = of_match_ptr(cypress_sf_of_match),
230230
},
231231
.id_table = cypress_sf_id_table,

0 commit comments

Comments
 (0)