@@ -523,8 +523,7 @@ static int mma9551_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
-static int mma9551_runtime_suspend(struct device *dev)
+static __maybe_unused int mma9551_runtime_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct mma9551_data *data = iio_priv(indio_dev);
@@ -541,7 +540,7 @@ static int mma9551_runtime_suspend(struct device *dev)
return 0;
}
-static int mma9551_runtime_resume(struct device *dev)
+static __maybe_unused int mma9551_runtime_resume(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct mma9551_data *data = iio_priv(indio_dev);
@@ -555,10 +554,8 @@ static int mma9551_runtime_resume(struct device *dev)
return 0;
}
-#endif
-#ifdef CONFIG_PM_SLEEP
-static int mma9551_suspend(struct device *dev)
+static __maybe_unused int mma9551_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct mma9551_data *data = iio_priv(indio_dev);
@@ -571,7 +568,7 @@ static int mma9551_suspend(struct device *dev)
return ret;
}
-static int mma9551_resume(struct device *dev)
+static __maybe_unused int mma9551_resume(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct mma9551_data *data = iio_priv(indio_dev);
@@ -583,9 +580,8 @@ static int mma9551_resume(struct device *dev)
return ret;
}
-#endif
-static const struct dev_pm_ops mma9551_pm_ops = {
+static __maybe_unused const struct dev_pm_ops mma9551_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mma9551_suspend, mma9551_resume)
SET_RUNTIME_PM_OPS(mma9551_runtime_suspend,
mma9551_runtime_resume, NULL)
@@ -609,7 +605,7 @@ static struct i2c_driver mma9551_driver = {
.driver = {
.name = MMA9551_DRV_NAME,
.acpi_match_table = ACPI_PTR(mma9551_acpi_match),
- .pm = &mma9551_pm_ops,
+ .pm = pm_ptr(&mma9551_pm_ops),
},
.probe = mma9551_probe,
.remove = mma9551_remove,