@@ -993,8 +993,7 @@ static int sx9500_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int sx9500_suspend(struct device *dev)
+static __maybe_unused int sx9500_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct sx9500_data *data = iio_priv(indio_dev);
@@ -1017,7 +1016,7 @@ static int sx9500_suspend(struct device *dev)
return ret;
}
-static int sx9500_resume(struct device *dev)
+static __maybe_unused int sx9500_resume(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
struct sx9500_data *data = iio_priv(indio_dev);
@@ -1030,11 +1029,8 @@ static int sx9500_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM_SLEEP */
-static const struct dev_pm_ops sx9500_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(sx9500_suspend, sx9500_resume)
-};
+static SIMPLE_DEV_PM_OPS(sx9500_pm_ops, sx9500_suspend, sx9500_resume);
static const struct acpi_device_id sx9500_acpi_match[] = {
{"SSX9500", 0},
@@ -1060,7 +1056,7 @@ static struct i2c_driver sx9500_driver = {
.name = SX9500_DRIVER_NAME,
.acpi_match_table = ACPI_PTR(sx9500_acpi_match),
.of_match_table = of_match_ptr(sx9500_of_match),
- .pm = &sx9500_pm_ops,
+ .pm = pm_ptr(&sx9500_pm_ops),
},
.probe = sx9500_probe,
.remove = sx9500_remove,