Skip to content

Commit e2eaf9e

Browse files
jic23dtor
authored andcommitted
Input: s6sy761 - switch to SYSTEM_SLEEP_/RUNTIME_PM_OPS() and pm_ptr()
SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are deprecated as they require explicit protection against unused function warnings. The new combination of pm_ptr() and SYSTEM_SLEEP_PM_OPS()/ RUNTIME_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]> Cc: Caleb Connolly <[email protected]> Cc: Andi Shyti <[email protected]> Tested-by: Caleb Connolly <[email protected]> # oneplus-guacamole Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent c51283d commit e2eaf9e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

drivers/input/touchscreen/s6sy761.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -479,23 +479,23 @@ static void s6sy761_remove(struct i2c_client *client)
479479
pm_runtime_disable(&client->dev);
480480
}
481481

482-
static int __maybe_unused s6sy761_runtime_suspend(struct device *dev)
482+
static int s6sy761_runtime_suspend(struct device *dev)
483483
{
484484
struct s6sy761_data *sdata = dev_get_drvdata(dev);
485485

486486
return i2c_smbus_write_byte_data(sdata->client,
487487
S6SY761_APPLICATION_MODE, S6SY761_APP_SLEEP);
488488
}
489489

490-
static int __maybe_unused s6sy761_runtime_resume(struct device *dev)
490+
static int s6sy761_runtime_resume(struct device *dev)
491491
{
492492
struct s6sy761_data *sdata = dev_get_drvdata(dev);
493493

494494
return i2c_smbus_write_byte_data(sdata->client,
495495
S6SY761_APPLICATION_MODE, S6SY761_APP_NORMAL);
496496
}
497497

498-
static int __maybe_unused s6sy761_suspend(struct device *dev)
498+
static int s6sy761_suspend(struct device *dev)
499499
{
500500
struct s6sy761_data *sdata = dev_get_drvdata(dev);
501501

@@ -504,7 +504,7 @@ static int __maybe_unused s6sy761_suspend(struct device *dev)
504504
return 0;
505505
}
506506

507-
static int __maybe_unused s6sy761_resume(struct device *dev)
507+
static int s6sy761_resume(struct device *dev)
508508
{
509509
struct s6sy761_data *sdata = dev_get_drvdata(dev);
510510

@@ -514,9 +514,8 @@ static int __maybe_unused s6sy761_resume(struct device *dev)
514514
}
515515

516516
static const struct dev_pm_ops s6sy761_pm_ops = {
517-
SET_SYSTEM_SLEEP_PM_OPS(s6sy761_suspend, s6sy761_resume)
518-
SET_RUNTIME_PM_OPS(s6sy761_runtime_suspend,
519-
s6sy761_runtime_resume, NULL)
517+
SYSTEM_SLEEP_PM_OPS(s6sy761_suspend, s6sy761_resume)
518+
RUNTIME_PM_OPS(s6sy761_runtime_suspend, s6sy761_runtime_resume, NULL)
520519
};
521520

522521
#ifdef CONFIG_OF
@@ -537,7 +536,7 @@ static struct i2c_driver s6sy761_driver = {
537536
.driver = {
538537
.name = S6SY761_DEV_NAME,
539538
.of_match_table = of_match_ptr(s6sy761_of_match),
540-
.pm = &s6sy761_pm_ops,
539+
.pm = pm_ptr(&s6sy761_pm_ops),
541540
},
542541
.probe_new = s6sy761_probe,
543542
.remove = s6sy761_remove,

0 commit comments

Comments
 (0)