mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-19 02:54:00 +08:00
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>
This commit is contained in:
parent
be45d422d9
commit
52f30f7717
@ -596,8 +596,10 @@ static int max6639_remove(struct i2c_client *client)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int max6639_suspend(struct i2c_client *client, pm_message_t mesg)
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
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);
|
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
|
||||||
if (data < 0)
|
if (data < 0)
|
||||||
return data;
|
return data;
|
||||||
@ -606,8 +608,9 @@ static int max6639_suspend(struct i2c_client *client, pm_message_t mesg)
|
|||||||
MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY);
|
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);
|
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
|
||||||
if (data < 0)
|
if (data < 0)
|
||||||
return data;
|
return data;
|
||||||
@ -615,6 +618,7 @@ static int max6639_resume(struct i2c_client *client)
|
|||||||
return i2c_smbus_write_byte_data(client,
|
return i2c_smbus_write_byte_data(client,
|
||||||
MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
|
MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_PM_SLEEP */
|
||||||
|
|
||||||
static const struct i2c_device_id max6639_id[] = {
|
static const struct i2c_device_id max6639_id[] = {
|
||||||
{"max6639", 0},
|
{"max6639", 0},
|
||||||
@ -623,15 +627,18 @@ static const struct i2c_device_id max6639_id[] = {
|
|||||||
|
|
||||||
MODULE_DEVICE_TABLE(i2c, 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 = {
|
static struct i2c_driver max6639_driver = {
|
||||||
.class = I2C_CLASS_HWMON,
|
.class = I2C_CLASS_HWMON,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "max6639",
|
.name = "max6639",
|
||||||
|
.pm = &max6639_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = max6639_probe,
|
.probe = max6639_probe,
|
||||||
.remove = max6639_remove,
|
.remove = max6639_remove,
|
||||||
.suspend = max6639_suspend,
|
|
||||||
.resume = max6639_resume,
|
|
||||||
.id_table = max6639_id,
|
.id_table = max6639_id,
|
||||||
.detect = max6639_detect,
|
.detect = max6639_detect,
|
||||||
.address_list = normal_i2c,
|
.address_list = normal_i2c,
|
||||||
|
Loading…
Reference in New Issue
Block a user