diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-03-22 16:23:58 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-04-01 13:24:08 -0400 |
commit | 52f30f77171f934cb9562908cb279178b890a048 (patch) | |
tree | 1c6f67cfe7954a4fc971bed22672631b65c47a78 | |
parent | be45d422d96ba22ecd0e34690644099d172e9c6d (diff) |
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.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
[guenter.roeck@ericsson.com: Added missing #ifdef around pm functions]
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
-rw-r--r-- | drivers/hwmon/max6639.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c index 193067e27b6f..de8f7adaccbd 100644 --- a/drivers/hwmon/max6639.c +++ b/drivers/hwmon/max6639.c | |||
@@ -596,8 +596,10 @@ static int max6639_remove(struct i2c_client *client) | |||
596 | return 0; | 596 | return 0; |
597 | } | 597 | } |
598 | 598 | ||
599 | static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) | 599 | #ifdef CONFIG_PM_SLEEP |
600 | static int max6639_suspend(struct device *dev) | ||
600 | { | 601 | { |
602 | struct i2c_client *client = to_i2c_client(dev); | ||
601 | int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); | 603 | int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); |
602 | if (data < 0) | 604 | if (data < 0) |
603 | return data; | 605 | return data; |
@@ -606,8 +608,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg) | |||
606 | MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY); | 608 | MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY); |
607 | } | 609 | } |
608 | 610 | ||
609 | static int max6639_resume(struct i2c_client *client) | 611 | static int max6639_resume(struct device *dev) |
610 | { | 612 | { |
613 | struct i2c_client *client = to_i2c_client(dev); | ||
611 | int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); | 614 | int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG); |
612 | if (data < 0) | 615 | if (data < 0) |
613 | return data; | 616 | return data; |
@@ -615,6 +618,7 @@ static int max6639_resume(struct i2c_client *client) | |||
615 | return i2c_smbus_write_byte_data(client, | 618 | return i2c_smbus_write_byte_data(client, |
616 | MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY); | 619 | MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY); |
617 | } | 620 | } |
621 | #endif /* CONFIG_PM_SLEEP */ | ||
618 | 622 | ||
619 | static const struct i2c_device_id max6639_id[] = { | 623 | static const struct i2c_device_id max6639_id[] = { |
620 | {"max6639", 0}, | 624 | {"max6639", 0}, |
@@ -623,15 +627,18 @@ static const struct i2c_device_id max6639_id[] = { | |||
623 | 627 | ||
624 | MODULE_DEVICE_TABLE(i2c, max6639_id); | 628 | MODULE_DEVICE_TABLE(i2c, max6639_id); |
625 | 629 | ||
630 | static const struct dev_pm_ops max6639_pm_ops = { | ||
631 | SET_SYSTEM_SLEEP_PM_OPS(max6639_suspend, max6639_resume) | ||
632 | }; | ||
633 | |||
626 | static struct i2c_driver max6639_driver = { | 634 | static struct i2c_driver max6639_driver = { |
627 | .class = I2C_CLASS_HWMON, | 635 | .class = I2C_CLASS_HWMON, |
628 | .driver = { | 636 | .driver = { |
629 | .name = "max6639", | 637 | .name = "max6639", |
638 | .pm = &max6639_pm_ops, | ||
630 | }, | 639 | }, |
631 | .probe = max6639_probe, | 640 | .probe = max6639_probe, |
632 | .remove = max6639_remove, | 641 | .remove = max6639_remove, |
633 | .suspend = max6639_suspend, | ||
634 | .resume = max6639_resume, | ||
635 | .id_table = max6639_id, | 642 | .id_table = max6639_id, |
636 | .detect = max6639_detect, | 643 | .detect = max6639_detect, |
637 | .address_list = normal_i2c, | 644 | .address_list = normal_i2c, |