summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-06 07:05:51 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-02-16 01:06:26 +0100
commit5ec662e7a6b8bd266382c8e7a3f236ffc8e1acf9 (patch)
treeae4892662d24feabfc6dd25dbe2af4fad5182b41 /drivers
parentInput: bfin_rotary - fix potential oops in interrupt handler (diff)
downloadlinux-5ec662e7a6b8bd266382c8e7a3f236ffc8e1acf9.tar.xz
linux-5ec662e7a6b8bd266382c8e7a3f236ffc8e1acf9.zip
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')
-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)
return 0;
}
-#ifdef CONFIG_PM
-static int bfin_rotary_suspend(struct device *dev)
+static int __maybe_unused bfin_rotary_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct bfin_rot *rotary = platform_get_drvdata(pdev);
@@ -226,7 +225,7 @@ static int bfin_rotary_suspend(struct device *dev)
return 0;
}
-static int bfin_rotary_resume(struct device *dev)
+static int __maybe_unused bfin_rotary_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct bfin_rot *rotary = platform_get_drvdata(pdev);
@@ -244,20 +243,15 @@ static int bfin_rotary_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops bfin_rotary_pm_ops = {
- .suspend = bfin_rotary_suspend,
- .resume = bfin_rotary_resume,
-};
-#endif
+static SIMPLE_DEV_PM_OPS(bfin_rotary_pm_ops,
+ bfin_rotary_suspend, bfin_rotary_resume);
static struct platform_driver bfin_rotary_device_driver = {
.probe = bfin_rotary_probe,
.remove = bfin_rotary_remove,
.driver = {
.name = "bfin-rotary",
-#ifdef CONFIG_PM
.pm = &bfin_rotary_pm_ops,
-#endif
},
};
module_platform_driver(bfin_rotary_device_driver);