aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-06 01:05:51 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-15 19:06:26 -0500
commit5ec662e7a6b8bd266382c8e7a3f236ffc8e1acf9 (patch)
treeae4892662d24feabfc6dd25dbe2af4fad5182b41 /drivers/input
parent7694f44d63c61883fefba6e8ad12075f17d3ebd3 (diff)
Input: bfin_rotary - mark suspend and resume code as __maybe_unused
Instead of using #ifdef to guard potentially unused suspend and resume code let's mark them as __maybe_unused so they still get discarded if they are not used but we do not get warning. This allows for better compile coverage. Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/bfin_rotary.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
index 2bf93df9403f..994f7b0119fe 100644
--- a/drivers/input/misc/bfin_rotary.c
+++ b/drivers/input/misc/bfin_rotary.c
@@ -210,8 +210,7 @@ static int bfin_rotary_remove(struct platform_device *pdev)
210 return 0; 210 return 0;
211} 211}
212 212
213#ifdef CONFIG_PM 213static int __maybe_unused bfin_rotary_suspend(struct device *dev)
214static int bfin_rotary_suspend(struct device *dev)
215{ 214{
216 struct platform_device *pdev = to_platform_device(dev); 215 struct platform_device *pdev = to_platform_device(dev);
217 struct bfin_rot *rotary = platform_get_drvdata(pdev); 216 struct bfin_rot *rotary = platform_get_drvdata(pdev);
@@ -226,7 +225,7 @@ static int bfin_rotary_suspend(struct device *dev)
226 return 0; 225 return 0;
227} 226}
228 227
229static int bfin_rotary_resume(struct device *dev) 228static int __maybe_unused bfin_rotary_resume(struct device *dev)
230{ 229{
231 struct platform_device *pdev = to_platform_device(dev); 230 struct platform_device *pdev = to_platform_device(dev);
232 struct bfin_rot *rotary = platform_get_drvdata(pdev); 231 struct bfin_rot *rotary = platform_get_drvdata(pdev);
@@ -244,20 +243,15 @@ static int bfin_rotary_resume(struct device *dev)
244 return 0; 243 return 0;
245} 244}
246 245
247static const struct dev_pm_ops bfin_rotary_pm_ops = { 246static SIMPLE_DEV_PM_OPS(bfin_rotary_pm_ops,
248 .suspend = bfin_rotary_suspend, 247 bfin_rotary_suspend, bfin_rotary_resume);
249 .resume = bfin_rotary_resume,
250};
251#endif
252 248
253static struct platform_driver bfin_rotary_device_driver = { 249static struct platform_driver bfin_rotary_device_driver = {
254 .probe = bfin_rotary_probe, 250 .probe = bfin_rotary_probe,
255 .remove = bfin_rotary_remove, 251 .remove = bfin_rotary_remove,
256 .driver = { 252 .driver = {
257 .name = "bfin-rotary", 253 .name = "bfin-rotary",
258#ifdef CONFIG_PM
259 .pm = &bfin_rotary_pm_ops, 254 .pm = &bfin_rotary_pm_ops,
260#endif
261 }, 255 },
262}; 256};
263module_platform_driver(bfin_rotary_device_driver); 257module_platform_driver(bfin_rotary_device_driver);