@@ -242,7 +242,6 @@ static int max7359_probe(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int max7359_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -267,9 +266,8 @@ static int max7359_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume);
static const struct i2c_device_id max7359_ids[] = {
{ "max7359", 0 },
@@ -280,7 +278,7 @@ MODULE_DEVICE_TABLE(i2c, max7359_ids);
static struct i2c_driver max7359_i2c_driver = {
.driver = {
.name = "max7359",
- .pm = &max7359_pm,
+ .pm = pm_sleep_ptr(&max7359_pm),
},
.probe_new = max7359_probe,
.id_table = max7359_ids,