Commit 5ec662e7 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 7694f44d
...@@ -210,8 +210,7 @@ static int bfin_rotary_remove(struct platform_device *pdev) ...@@ -210,8 +210,7 @@ static int bfin_rotary_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused bfin_rotary_suspend(struct device *dev)
static int bfin_rotary_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct bfin_rot *rotary = platform_get_drvdata(pdev); struct bfin_rot *rotary = platform_get_drvdata(pdev);
...@@ -226,7 +225,7 @@ static int bfin_rotary_suspend(struct device *dev) ...@@ -226,7 +225,7 @@ static int bfin_rotary_suspend(struct device *dev)
return 0; 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 platform_device *pdev = to_platform_device(dev);
struct bfin_rot *rotary = platform_get_drvdata(pdev); struct bfin_rot *rotary = platform_get_drvdata(pdev);
...@@ -244,20 +243,15 @@ static int bfin_rotary_resume(struct device *dev) ...@@ -244,20 +243,15 @@ static int bfin_rotary_resume(struct device *dev)
return 0; return 0;
} }
static const struct dev_pm_ops bfin_rotary_pm_ops = { static SIMPLE_DEV_PM_OPS(bfin_rotary_pm_ops,
.suspend = bfin_rotary_suspend, bfin_rotary_suspend, bfin_rotary_resume);
.resume = bfin_rotary_resume,
};
#endif
static struct platform_driver bfin_rotary_device_driver = { static struct platform_driver bfin_rotary_device_driver = {
.probe = bfin_rotary_probe, .probe = bfin_rotary_probe,
.remove = bfin_rotary_remove, .remove = bfin_rotary_remove,
.driver = { .driver = {
.name = "bfin-rotary", .name = "bfin-rotary",
#ifdef CONFIG_PM
.pm = &bfin_rotary_pm_ops, .pm = &bfin_rotary_pm_ops,
#endif
}, },
}; };
module_platform_driver(bfin_rotary_device_driver); module_platform_driver(bfin_rotary_device_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment