hwmon: max6639: Convert to dev_pm_ops
PATCH 1/1 hwmon: max6639: Convert to dev_pm_ops
The I2C specific PM operations have been deprecated and printing a warning on boot for over a year now.
--- drivers/hwmon/max6639.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/hwmon/max6639.c +9 -4
@@ -596,8 +596,9 @@ static int max6639_remove(struct i2c_client *client)return 0 ; } -static int max6639_suspend (struct i2c_client *client,pm_message_t mesg) +static int max6639_suspend (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);int data =i2c_smbus_read_byte_data (client,MAX6639_REG_GCONFIG );if (data <0 )return data;
@@ -606,8 +607,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY); } -static int max6639_resume (struct i2c_client *client) +static int max6639_resume (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);int data =i2c_smbus_read_byte_data (client,MAX6639_REG_GCONFIG );if (data <0 )return data;
@@ -623,15 +625,18 @@ static const struct i2c_device_id max6639_id[] = {MODULE_DEVICE_TABLE (i2c, max6639_id); +static const struct dev_pm_ops max6639_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (max6639_suspend, max6639_resume) +}; +static struct i2c_driver max6639_driver = { .class =I2C_CLASS_HWMON , .driver = { .name ="max6639" , + .pm = &max6639_pm_ops, }, .probe = max6639_probe, .remove = max6639_remove, - .suspend = max6639_suspend, - .resume = max6639_resume, .id_table = max6639_id, .detect = max6639_detect, .address_list = normal_i2c,
Signature · 7 lines
1.7.9.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
AppliedQuoted 8 lines · Mark Brown
The I2C specific PM operations have been deprecated and printing a warning on boot for over a year now.
Signed-off-by Mark Brown <[email protected]>--- drivers/hwmon/max6639.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
Applied, thanks.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Mark,
Quoted 5 lines · Mark Brown
The I2C specific PM operations have been deprecated and printing a warning on boot for over a year now.
Signed-off-by Mark Brown <[email protected]>---
Actually, there is a problem with your patch. With the patch applied, my nightly builds tell me:
Build: /home/groeck/local/linux-staging:hwmon:2:3
/tmp/linux.6026/drivers/hwmon/max6639.c:599: warning: 'max6639_suspend' defined but not used /tmp/linux.6026/drivers/hwmon/max6639.c:610: warning: 'max6639_resume' defined but not used
--------------------
This suggests that something is wrong if CONFIG_PM is not set (missing #ifdef around the suspend/resume functions ? Or is there some better way to do this without #ifdef ?).
I'll back out your patch for now. Please have a look.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH 1/1 hwmon: max6639: Convert to dev_pm_ops
In reply to Mark BrownThe I2C specific PM operations have been deprecated and printing a warning on boot for over a year now.
--- drivers/hwmon/max6639.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
drivers/hwmon/max6639.c +10 -4
@@ -596,8 +596,9 @@ static int max6639_remove(struct i2c_client *client)return 0 ; } -static int max6639_suspend (struct i2c_client *client,pm_message_t mesg) +static int max6639_suspend (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);int data =i2c_smbus_read_byte_data (client,MAX6639_REG_GCONFIG );if (data <0 )return data;
@@ -606,8 +607,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY); } -static int max6639_resume (struct i2c_client *client) +static int max6639_resume (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);int data =i2c_smbus_read_byte_data (client,MAX6639_REG_GCONFIG );if (data <0 )return data;
@@ -623,15 +625,19 @@ static const struct i2c_device_id max6639_id[] = {MODULE_DEVICE_TABLE (i2c, max6639_id); +static const struct dev_pm_ops max6639_pm_ops = { + .suspend = max6639_suspend, + .resume = max6639_resume, +}; +static struct i2c_driver max6639_driver = { .class =I2C_CLASS_HWMON , .driver = { .name ="max6639" , + .pm = &max6639_pm_ops, }, .probe = max6639_probe, .remove = max6639_remove, - .suspend = max6639_suspend, - .resume = max6639_resume, .id_table = max6639_id, .detect = max6639_detect, .address_list = normal_i2c,
Signature · 7 lines
1.7.9.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 4 lines · Mark Brown
The I2C specific PM operations have been deprecated and printing a warning on boot for over a year now.
Signed-off-by Mark Brown <[email protected]>
I'll stick with SET_SYSTEM_SLEEP_PM_OPS and the added #ifdef.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors