aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-12-22 19:38:15 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-12-28 17:29:23 +0000
commit614e85547870802e3f26603c9d00937059a782fe (patch)
treea4dd3b1f6d85f07b93c337873cac2adaa99a7307
parent05eb4df14be6e2f6dd65be8f2416e678f9eb0062 (diff)
downloadiio-614e85547870802e3f26603c9d00937059a782fe.tar.gz
Input: ambakmi - 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>
-rw-r--r--drivers/input/serio/ambakmi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index c391700fc4ae2..8fbfa448be4ac 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -170,7 +170,7 @@ static void amba_kmi_remove(struct amba_device *dev)
amba_release_regions(dev);
}
-static int __maybe_unused amba_kmi_resume(struct device *dev)
+static int amba_kmi_resume(struct device *dev)
{
struct amba_kmi_port *kmi = dev_get_drvdata(dev);
@@ -180,7 +180,7 @@ static int __maybe_unused amba_kmi_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(amba_kmi_dev_pm_ops, NULL, amba_kmi_resume);
static const struct amba_id amba_kmi_idtable[] = {
{
@@ -196,7 +196,7 @@ static struct amba_driver ambakmi_driver = {
.drv = {
.name = "kmi-pl050",
.owner = THIS_MODULE,
- .pm = &amba_kmi_dev_pm_ops,
+ .pm = pm_sleep_ptr(&amba_kmi_dev_pm_ops),
},
.id_table = amba_kmi_idtable,
.probe = amba_kmi_probe,