@@ -301,14 +301,13 @@ static int mpl3115_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int mpl3115_suspend(struct device *dev)
+static __maybe_unused int mpl3115_suspend(struct device *dev)
{
return mpl3115_standby(iio_priv(i2c_get_clientdata(
to_i2c_client(dev))));
}
-static int mpl3115_resume(struct device *dev)
+static __maybe_unused int mpl3115_resume(struct device *dev)
{
struct mpl3115_data *data = iio_priv(i2c_get_clientdata(
to_i2c_client(dev)));
@@ -318,10 +317,6 @@ static int mpl3115_resume(struct device *dev)
}
static SIMPLE_DEV_PM_OPS(mpl3115_pm_ops, mpl3115_suspend, mpl3115_resume);
-#define MPL3115_PM_OPS (&mpl3115_pm_ops)
-#else
-#define MPL3115_PM_OPS NULL
-#endif
static const struct i2c_device_id mpl3115_id[] = {
{ "mpl3115", 0 },
@@ -339,7 +334,7 @@ static struct i2c_driver mpl3115_driver = {
.driver = {
.name = "mpl3115",
.of_match_table = mpl3115_of_match,
- .pm = MPL3115_PM_OPS,
+ .pm = pm_ptr(&mpl3115_pm_ops),
},
.probe = mpl3115_probe,
.remove = mpl3115_remove,