aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-12-22 19:20:46 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-12-28 17:29:22 +0000
commit0fb1bfed605c973df0b38bb1c58112f6e6c5e52b (patch)
tree8ab1d39bf8bc2b6f569507aba71b78e5f63b39bf
parentc05263036762aa772ab5e958b0f2f8af39129639 (diff)
downloadiio-0fb1bfed605c973df0b38bb1c58112f6e6c5e52b.tar.gz
Input: stpmic1_onekey - 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 <Jonathan.Cameron@huawei.com> Cc: Pascal Paillet <p.paillet@st.com>
-rw-r--r--drivers/input/misc/stpmic1_onkey.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/input/misc/stpmic1_onkey.c b/drivers/input/misc/stpmic1_onkey.c
index d8dc2f2f80000..d5ebca7b90a59 100644
--- a/drivers/input/misc/stpmic1_onkey.c
+++ b/drivers/input/misc/stpmic1_onkey.c
@@ -142,7 +142,7 @@ static int stpmic1_onkey_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
+static int stpmic1_onkey_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
@@ -154,7 +154,7 @@ static int __maybe_unused stpmic1_onkey_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused stpmic1_onkey_resume(struct device *dev)
+static int stpmic1_onkey_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct stpmic1_onkey *onkey = platform_get_drvdata(pdev);
@@ -166,9 +166,9 @@ static int __maybe_unused stpmic1_onkey_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm,
- stpmic1_onkey_suspend,
- stpmic1_onkey_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stpmic1_onkey_pm,
+ stpmic1_onkey_suspend,
+ stpmic1_onkey_resume);
static const struct of_device_id of_stpmic1_onkey_match[] = {
{ .compatible = "st,stpmic1-onkey" },
@@ -182,7 +182,7 @@ static struct platform_driver stpmic1_onkey_driver = {
.driver = {
.name = "stpmic1_onkey",
.of_match_table = of_match_ptr(of_stpmic1_onkey_match),
- .pm = &stpmic1_onkey_pm,
+ .pm = pm_sleep_ptr(&stpmic1_onkey_pm),
},
};
module_platform_driver(stpmic1_onkey_driver);