Use the new EXPORT_GPL_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros
to handle the .suspend/.resume callbacks.
These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/mfd/88pm800.c | 2 +-
drivers/mfd/88pm805.c | 2 +-
drivers/mfd/88pm80x.c | 5 +----
3 files changed, 3 insertions(+), 6 deletions(-)
@@ -599,7 +599,7 @@ static int pm800_remove(struct i2c_client *client)
static struct i2c_driver pm800_driver = {
.driver = {
.name = "88PM800",
- .pm = &pm80x_pm_ops,
+ .pm = pm_sleep_ptr(&pm80x_pm_ops),
},
.probe = pm800_probe,
.remove = pm800_remove,
@@ -254,7 +254,7 @@ static int pm805_remove(struct i2c_client *client)
static struct i2c_driver pm805_driver = {
.driver = {
.name = "88PM805",
- .pm = &pm80x_pm_ops,
+ .pm = pm_sleep_ptr(&pm80x_pm_ops),
},
.probe = pm805_probe,
.remove = pm805_remove,
@@ -129,7 +129,6 @@ int pm80x_deinit(void)
}
EXPORT_SYMBOL_GPL(pm80x_deinit);
-#ifdef CONFIG_PM_SLEEP
static int pm80x_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -153,10 +152,8 @@ static int pm80x_resume(struct device *dev)
return 0;
}
-#endif
-SIMPLE_DEV_PM_OPS(pm80x_pm_ops, pm80x_suspend, pm80x_resume);
-EXPORT_SYMBOL_GPL(pm80x_pm_ops);
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(pm80x_pm_ops, pm80x_suspend, pm80x_resume);
MODULE_DESCRIPTION("I2C Driver for Marvell 88PM80x");
MODULE_AUTHOR("Qiao Zhou <zhouqiao@marvell.com>");