Skip to content

Commit 8c1f3b2

Browse files
jic23dtor
authored andcommitted
Input: ipaq-micro-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]> Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent ba4de5d commit 8c1f3b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/keyboard/ipaq-micro-keys.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int micro_key_probe(struct platform_device *pdev)
124124
return 0;
125125
}
126126

127-
static int __maybe_unused micro_key_suspend(struct device *dev)
127+
static int micro_key_suspend(struct device *dev)
128128
{
129129
struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
130130

@@ -133,7 +133,7 @@ static int __maybe_unused micro_key_suspend(struct device *dev)
133133
return 0;
134134
}
135135

136-
static int __maybe_unused micro_key_resume(struct device *dev)
136+
static int micro_key_resume(struct device *dev)
137137
{
138138
struct ipaq_micro_keys *keys = dev_get_drvdata(dev);
139139
struct input_dev *input = keys->input;
@@ -148,13 +148,13 @@ static int __maybe_unused micro_key_resume(struct device *dev)
148148
return 0;
149149
}
150150

151-
static SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
152-
micro_key_suspend, micro_key_resume);
151+
static DEFINE_SIMPLE_DEV_PM_OPS(micro_key_dev_pm_ops,
152+
micro_key_suspend, micro_key_resume);
153153

154154
static struct platform_driver micro_key_device_driver = {
155155
.driver = {
156156
.name = "ipaq-micro-keys",
157-
.pm = &micro_key_dev_pm_ops,
157+
.pm = pm_sleep_ptr(&micro_key_dev_pm_ops),
158158
},
159159
.probe = micro_key_probe,
160160
};

0 commit comments

Comments
 (0)