Skip to content

Commit b346200

Browse files
jic23dtor
authored andcommitted
Input: mtk-pmic-keys - 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]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 8362cb5 commit b346200

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/keyboard/mtk-pmic-keys.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static int mtk_pmic_key_setup(struct mtk_pmic_keys *keys,
231231
return 0;
232232
}
233233

234-
static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
234+
static int mtk_pmic_keys_suspend(struct device *dev)
235235
{
236236
struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
237237
int index;
@@ -247,7 +247,7 @@ static int __maybe_unused mtk_pmic_keys_suspend(struct device *dev)
247247
return 0;
248248
}
249249

250-
static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
250+
static int mtk_pmic_keys_resume(struct device *dev)
251251
{
252252
struct mtk_pmic_keys *keys = dev_get_drvdata(dev);
253253
int index;
@@ -263,8 +263,8 @@ static int __maybe_unused mtk_pmic_keys_resume(struct device *dev)
263263
return 0;
264264
}
265265

266-
static SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
267-
mtk_pmic_keys_resume);
266+
static DEFINE_SIMPLE_DEV_PM_OPS(mtk_pmic_keys_pm_ops, mtk_pmic_keys_suspend,
267+
mtk_pmic_keys_resume);
268268

269269
static const struct of_device_id of_mtk_pmic_keys_match_tbl[] = {
270270
{
@@ -387,7 +387,7 @@ static struct platform_driver pmic_keys_pdrv = {
387387
.driver = {
388388
.name = "mtk-pmic-keys",
389389
.of_match_table = of_mtk_pmic_keys_match_tbl,
390-
.pm = &mtk_pmic_keys_pm_ops,
390+
.pm = pm_sleep_ptr(&mtk_pmic_keys_pm_ops),
391391
},
392392
};
393393

0 commit comments

Comments
 (0)