Skip to content

Commit 90208b3

Browse files
jic23dtor
authored andcommitted
Input: stmfts - 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: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 452fcd2 commit 90208b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/input/touchscreen/stmfts.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ static void stmfts_remove(struct i2c_client *client)
742742
pm_runtime_disable(&client->dev);
743743
}
744744

745-
static int __maybe_unused stmfts_runtime_suspend(struct device *dev)
745+
static int stmfts_runtime_suspend(struct device *dev)
746746
{
747747
struct stmfts_data *sdata = dev_get_drvdata(dev);
748748
int ret;
@@ -754,7 +754,7 @@ static int __maybe_unused stmfts_runtime_suspend(struct device *dev)
754754
return ret;
755755
}
756756

757-
static int __maybe_unused stmfts_runtime_resume(struct device *dev)
757+
static int stmfts_runtime_resume(struct device *dev)
758758
{
759759
struct stmfts_data *sdata = dev_get_drvdata(dev);
760760
int ret;
@@ -766,7 +766,7 @@ static int __maybe_unused stmfts_runtime_resume(struct device *dev)
766766
return ret;
767767
}
768768

769-
static int __maybe_unused stmfts_suspend(struct device *dev)
769+
static int stmfts_suspend(struct device *dev)
770770
{
771771
struct stmfts_data *sdata = dev_get_drvdata(dev);
772772

@@ -775,16 +775,16 @@ static int __maybe_unused stmfts_suspend(struct device *dev)
775775
return 0;
776776
}
777777

778-
static int __maybe_unused stmfts_resume(struct device *dev)
778+
static int stmfts_resume(struct device *dev)
779779
{
780780
struct stmfts_data *sdata = dev_get_drvdata(dev);
781781

782782
return stmfts_power_on(sdata);
783783
}
784784

785785
static const struct dev_pm_ops stmfts_pm_ops = {
786-
SET_SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume)
787-
SET_RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL)
786+
SYSTEM_SLEEP_PM_OPS(stmfts_suspend, stmfts_resume)
787+
RUNTIME_PM_OPS(stmfts_runtime_suspend, stmfts_runtime_resume, NULL)
788788
};
789789

790790
#ifdef CONFIG_OF
@@ -805,7 +805,7 @@ static struct i2c_driver stmfts_driver = {
805805
.driver = {
806806
.name = STMFTS_DEV_NAME,
807807
.of_match_table = of_match_ptr(stmfts_of_match),
808-
.pm = &stmfts_pm_ops,
808+
.pm = pm_ptr(&stmfts_pm_ops),
809809
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
810810
},
811811
.probe_new = stmfts_probe,

0 commit comments

Comments
 (0)